diff options
author | Chris Wilson <chris+github@qwirx.com> | 2012-04-28 18:19:53 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2012-04-28 18:19:53 +0000 |
commit | 009c4414728e376c9bf3557ef0b4db9aa251d39b (patch) | |
tree | 2056c11c23c98df122c0c64d8fccb51ee5daab09 /bin | |
parent | 7b5f339fa350511457d84273dc2b122b161a8811 (diff) |
Allow BackupDaemon user to reset state for testing.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 17 | ||||
-rw-r--r-- | bin/bbackupd/BackupDaemon.h | 1 |
2 files changed, 12 insertions, 6 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index a1560072..3b920d37 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -721,12 +721,7 @@ void BackupDaemon::RunSyncNowWithExceptionHandling() DeleteCorruptBerkelyDbFiles(); } - // Clear state data - // Go back to beginning of time - mLastSyncTime = 0; - mClientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown; // no store marker, so download everything - DeleteAllLocations(); - DeleteAllIDMaps(); + ResetCachedState(); // Handle restart? if(StopRun()) @@ -789,6 +784,16 @@ void BackupDaemon::RunSyncNowWithExceptionHandling() OnBackupFinish(); } +void BackupDaemon::ResetCachedState() +{ + // Clear state data + // Go back to beginning of time + mLastSyncTime = 0; + mClientStoreMarker = BackupClientContext::ClientStoreMarker_NotKnown; // no store marker, so download everything + DeleteAllLocations(); + DeleteAllIDMaps(); +} + void BackupDaemon::RunSyncNow() { // Delete the serialised store object file, diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h index d6b00371..1d3c991e 100644 --- a/bin/bbackupd/BackupDaemon.h +++ b/bin/bbackupd/BackupDaemon.h @@ -117,6 +117,7 @@ public: void InitCrypto(); void RunSyncNowWithExceptionHandling(); void RunSyncNow(); + void ResetCachedState(); void OnBackupStart(); void OnBackupFinish(); // TouchFileInWorkingDir is only here for use by Boxi. |