]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Use async pool instead of EVENT_LOOP.
[stg.git] / projects / stargazer / main.cpp
index 825cba582e344faf7dfc5df230b5b192d7b7b043..ee14c3a895580cf3eceb4f6197b0b69986a30a07 100644 (file)
@@ -29,7 +29,7 @@
 #include "traffcounter_impl.h"
 #include "settings_impl.h"
 #include "pidfile.h"
-#include "eventloop.h"
+#include "async_pool.h"
 #include "stg_timer.h"
 
 #include "stg/user.h"
@@ -282,7 +282,7 @@ int main(int argc, char* argv[])
         return -1;
     }
 
-    auto& loop = EVENT_LOOP_SINGLETON::GetInstance();
+    STG::AsyncPoolST::start();
 
     StoreLoader storeLoader(settings);
     if (storeLoader.load())
@@ -292,18 +292,12 @@ int main(int argc, char* argv[])
         return -1;
     }
 
-    if (loop.Start())
-    {
-        printfd(__FILE__, "Event loop not started.\n");
-        WriteServLog("Event loop not started.");
-        return -1;
-    }
-
     auto& store = storeLoader.get();
     WriteServLog("Storage plugin: %s. Loading successfull.", store.GetVersion().c_str());
 
     AdminsImpl admins(store);
     TariffsImpl tariffs(&store);
+    tariffs.ReadTariffs();
     ServicesImpl services(&store);
     CorporationsImpl corps(&store);
     UsersImpl users(&settings, &store, &tariffs, services, admins.sysAdmin());
@@ -376,8 +370,7 @@ int main(int argc, char* argv[])
 
     manager.stop();
 
-    if (loop.Stop())
-        WriteServLog("Event loop not stopped.");
+    STG::AsyncPoolST::stop();
 
     if (!traffCnt.Stop())
         WriteServLog("Traffcounter: Stop successfull.");