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



//// Version Info //// 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 //// Script Caller Methods



+ 8
- 4
snfLOGmgr.cpp View File

} }


void DiscLogger::myTask() { // Main thread task 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: while(!isTimeToStop) { // Until it is time to stop:
CurrentThreadState(DiscLogger_Wait); // post our waiting and 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 CurrentThreadState(DiscLogger_Flush); // post our activity and
flush(); // flush our data to disc flush(); // flush our data to disc
} // then do it again. } // then do it again.
while(!TimeToDie) { // Do this until it's time to die. while(!TimeToDie) { // Do this until it's time to die.
if(Configured) { // If we are configured do our work. if(Configured) { // If we are configured do our work.
do_StatusReports(); // Make our status reports (chained). do_StatusReports(); // Make our status reports (chained).
Status.store(PersistentFileName); // Store our persistent data.
} }
WaitATic(); WaitATic();
} }
} }
} }
} }
// 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. 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. int snfLOGmgr::SecsSinceLastSync() { // Gets seconds since latest Sync.

Loading…
Cancel
Save