@ -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()
void RestServer::cacheUpdated()
@ -178,4 +178,6 @@ void RestServer::cacheUpdated()
void RestServer::stop()
@ -24,6 +24,7 @@ private:
HttpServer httpServer;
MasterServer::ServerMap *serverMap;
bool updatedCache = true;
@ -67,12 +67,8 @@ int main(int argc, char* argv[])
signal(SIGTERM, onExit);
masterServer->Start();
restServer->start();
thread rest_thread([]() { restServer->start();});
restAdminServer->start();
thread restAdmin_thread([]() { restAdminServer->start();});
rest_thread.join();
restAdmin_thread.join();
masterServer->Wait();
return 0;