X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffmsapp.cpp;h=973729955bbb4ebf0455f29eb65b72cd6aeb2c14;hb=56f67ecca96efc7b72d03c95c8c42cfb66e31468;hp=b30c1ba963a60140706d11dd16c8685f0f03a2e1;hpb=4855de56590e2f27d39036922339992c96bce9d1;p=fms.git diff --git a/src/fmsapp.cpp b/src/fmsapp.cpp index b30c1ba..9737299 100644 --- a/src/fmsapp.cpp +++ b/src/fmsapp.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #ifdef _WIN32 #include @@ -161,7 +162,12 @@ int FMSApp::main(const std::vector &args) // so we need to set the working directory again int rval=chdir(m_workingdirectory.c_str()); - if(m_displayhelp) + if(VerifyDB()==false) + { + std::cout << "The FMS database failed verification. It is most likely corrupt!" << std::endl; + logger().fatal("The FMS database failed verification. It is most likely corrupt!"); + } + else if(m_displayhelp) { } else if(m_showoptions) @@ -176,6 +182,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) @@ -248,6 +262,10 @@ void FMSApp::StartThreads() { logger().trace("FMSApp::StartThreads starting HTTPThread"); m_threads.Start(new HTTPThread()); + if(isInteractive()) + { + std::cout << "Started HTTP Thread" << std::endl; + } } else { @@ -260,6 +278,10 @@ void FMSApp::StartThreads() { logger().trace("FMSApp::StartThreads starting NNTPListener"); m_threads.Start(new NNTPListener()); + if(isInteractive()) + { + std::cout << "Started NNTP Thread" << std::endl; + } } else { @@ -272,6 +294,10 @@ void FMSApp::StartThreads() { logger().trace("FMSApp::StartThreads starting FreenetMasterThread"); m_threads.Start(new FreenetMasterThread()); + if(isInteractive()) + { + std::cout << "Started Freenet FCP Thread" << std::endl; + } } else {