#include <xmem.h>\r
#endif\r
\r
-bool wantshutdown=false;\r
+volatile bool wantshutdown=false;\r
\r
std::string CreateShortIdentityName(const std::string &name, const std::string &publickey)\r
{\r
{\r
\r
DateTime date;\r
+ std::string tempval="";\r
SQLite3DB::DB *db=SQLite3DB::DB::Instance();\r
\r
db->Open("fms.db3");\r
db->SetBusyTimeout(10000); // set timeout to 10 seconds\r
- //db->Execute("VACUUM;"); // not needed every startup\r
+\r
+ tempval="";\r
+ Option::Instance()->Get("VacuumOnStartup",tempval);\r
+ if(tempval=="true")\r
+ {\r
+ db->Execute("VACUUM;");\r
+ }\r
\r
db->Execute("CREATE TABLE IF NOT EXISTS tblDBVersion(\\r
Major INTEGER,\\r
st.Step();\r
st.Reset();\r
\r
+ st.Bind(0,"VacuumOnStartup");\r
+ st.Bind(1,"false");\r
+ st.Bind(2,"VACUUM the database every time FMS starts. This will defragment the free space in the database and create a smaller database file. Vacuuming the database can be CPU and disk intensive.");\r
+ st.Step();\r
+ st.Reset();\r
+\r
}\r
\r
void SetupLogFile()\r
\r
void Shutdown()\r
{\r
+\r
+ LogFile::Instance()->WriteLog(LogFile::LOGLEVEL_DEBUG,"FMS starting shutdown");\r
+\r
ThreadController::Instance()->ShutdownThreads();\r
\r
ShutdownNetwork();\r