[Master] Minor fixes

new-script-api
Koncord 7 years ago
parent cccbe753d7
commit 838e05521e

@ -58,10 +58,12 @@ void AdminRest::start()
*response << response400;
};
httpServer.start();
thr = thread([this](){httpServer.start();});
}
void AdminRest::stop()
{
httpServer.stop();
if(thr.joinable())
thr.join();
}

@ -19,6 +19,7 @@ public:
private:
HttpsServer httpServer;
std::shared_ptr<MasterServer> master;
std::thread thr;
};

@ -167,7 +167,7 @@ void RestServer::start()
*response << response400;
};
httpServer.start();
thr = thread([this](){httpServer.start();});
}
void RestServer::cacheUpdated()
@ -178,4 +178,6 @@ void RestServer::cacheUpdated()
void RestServer::stop()
{
httpServer.stop();
if(thr.joinable())
thr.join();
}

@ -24,6 +24,7 @@ private:
HttpServer httpServer;
MasterServer::ServerMap *serverMap;
bool updatedCache = true;
std::thread thr;
};

@ -67,12 +67,8 @@ int main(int argc, char* argv[])
signal(SIGTERM, onExit);
masterServer->Start();
thread rest_thread([]() { restServer->start();});
thread restAdmin_thread([]() { restAdminServer->start();});
rest_thread.join();
restAdmin_thread.join();
restServer->start();
restAdminServer->start();
masterServer->Wait();
return 0;

Loading…
Cancel
Save