version 0.3.19
[fms.git] / src / fmsapp.cpp
index ebebe4a..01fcf9a 100644 (file)
@@ -162,7 +162,12 @@ int FMSApp::main(const std::vector<std::string> &args)
        // so we need to set the working directory again\r
        int rval=chdir(m_workingdirectory.c_str());\r
 \r
-       if(m_displayhelp)\r
+       if(VerifyDB()==false)\r
+       {\r
+               std::cout << "The FMS database failed verification.  It is most likely corrupt!" << std::endl;\r
+               logger().fatal("The FMS database failed verification.  It is most likely corrupt!");\r
+       }\r
+       else if(m_displayhelp)\r
        {\r
        }\r
        else if(m_showoptions)\r
@@ -177,6 +182,14 @@ int FMSApp::main(const std::vector<std::string> &args)
        {\r
                logger().information("FMS startup v"FMS_VERSION);\r
 \r
+               std::string tempval="";\r
+               Option::Instance()->Get("VacuumOnStartup",tempval);\r
+               if(tempval=="true")\r
+               {\r
+                       logger().information("VACUUMing database");\r
+                       SQLite3DB::DB::Instance()->Execute("VACUUM;");\r
+               }\r
+\r
                StartThreads();\r
 \r
                if(isInteractive()==true)\r