X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffmsapp.cpp;h=8a462e292a9b966f530b016ca7a839e022f6c288;hb=07319f767b4c4f0e06e9957f217d5107b196617b;hp=94443c4cd8440e298bda8018b8b986b4bbea85d4;hpb=026dc6b2bc548c945359c4e166eff514f2c47c6a;p=fms.git diff --git a/src/fmsapp.cpp b/src/fmsapp.cpp index 94443c4..8a462e2 100644 --- a/src/fmsapp.cpp +++ b/src/fmsapp.cpp @@ -17,6 +17,8 @@ #include #include #include +#include +#include #ifdef _WIN32 #include @@ -99,7 +101,8 @@ void FMSApp::initialize(Poco::Util::Application &self) ServerApplication::initialize(self); // set working directory - fall back on application.dir if working directory isn't set - if(m_workingdirectory=="") + // if we are runing as a service, then working directory needs to be set to the application directory + if(m_workingdirectory=="" || config().getBool("application.runAsService",false)==true) { m_workingdirectory=config().getString("application.dir"); } @@ -174,6 +177,14 @@ int FMSApp::main(const std::vector &args) { logger().information("FMS startup v"FMS_VERSION); + std::string tempval=""; + Option::Instance()->Get("VacuumOnStartup",tempval); + if(tempval=="true") + { + logger().information("VACUUMing database"); + SQLite3DB::DB::Instance()->Execute("VACUUM;"); + } + StartThreads(); if(isInteractive()==true)