Browse Source

Moved persistent state aux store() operations to RecordSyncEvent

Changed DiscLogger wait time to 1 second
New engine version number 3.0.10

git-svn-id: https://svn.microneil.com/svn/SNFMulti/trunk@26 dc71a809-1921-45c4-985c-09c81d0142d9
wx
madscientist 15 years ago
parent
commit
4e1950efcd
2 changed files with 9 additions and 5 deletions
  1. 1
    1
      SNFMulti.cpp
  2. 8
    4
      snfLOGmgr.cpp

+ 1
- 1
SNFMulti.cpp View File

@@ -23,7 +23,7 @@ using namespace std;

//// Version Info

const char* SNF_ENGINE_VERSION = "SNFMulti Engine Version 3.0.9 Build: " __DATE__ " " __TIME__;
const char* SNF_ENGINE_VERSION = "SNFMulti Engine Version 3.0.10 Build: " __DATE__ " " __TIME__;

//// Script Caller Methods


+ 8
- 4
snfLOGmgr.cpp View File

@@ -79,10 +79,10 @@ void DiscLogger::flush() {
}

void DiscLogger::myTask() { // Main thread task
Sleeper WaitForIt(500); // How to wait a half second.
Sleeper WaitASecond(1000); // How to wait for 1 second.
while(!isTimeToStop) { // Until it is time to stop:
CurrentThreadState(DiscLogger_Wait); // post our waiting and
WaitForIt(); // we wait a second, then
WaitASecond(); // we wait a second, then
CurrentThreadState(DiscLogger_Flush); // post our activity and
flush(); // flush our data to disc
} // then do it again.
@@ -885,7 +885,6 @@ void snfLOGmgr::myTask() {
while(!TimeToDie) { // Do this until it's time to die.
if(Configured) { // If we are configured do our work.
do_StatusReports(); // Make our status reports (chained).
Status.store(PersistentFileName); // Store our persistent data.
}
WaitATic();
}
@@ -1829,9 +1828,14 @@ void snfLOGPersistentState::restore(string& FileNameToRestore) {
}
}
}
// 20090730_M - Moved persistent state aux saves to RecordSyncEvent. It makes
// sense for the persistent state to match the latext external record of state
// info. If SNFServer dies uncerimoneusly that is what we will remember.

void snfLOGmgr::RecordSyncEvent() { // Sets timestamp of latest Sync.
Status.LastSyncTime = Timestamp();
Status.LastSyncTime = Timestamp(); // Set the Sync time.
if(Configured) Status.store(PersistentFileName); // Store our persistent data.
}

int snfLOGmgr::SecsSinceLastSync() { // Gets seconds since latest Sync.

Loading…
Cancel
Save