Fixed errors when requesting short URLs, fixed race condition during shutdown of controller.

This commit is contained in:
Thulinma 2015-06-18 16:06:35 +02:00
parent a3354aeee6
commit eaabf9e800
2 changed files with 6 additions and 4 deletions

View file

@ -263,10 +263,6 @@ int main(int argc, char ** argv){
//join all joinable threads
statsThread.join();
monitorThread.join();
//give everything some time to print messages
Util::wait(100);
//close stderr to make the stderr reading thread exit
close(STDERR_FILENO);
//write config
if ( !Controller::WriteFile(Controller::conf.getString("configFile"), Controller::Storage.toString())){
std::cerr << "Error writing config " << Controller::conf.getString("configFile") << std::endl;
@ -281,6 +277,10 @@ int main(int argc, char ** argv){
}
//stop all child processes
Util::Procs::StopAll();
//give everything some time to print messages
Util::wait(100);
//close stderr to make the stderr reading thread exit
close(STDERR_FILENO);
std::cout << "Killed all processes, wrote config to disk. Exiting." << std::endl;
return 0;
}