|
|
@@ -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. |