From 009c4414728e376c9bf3557ef0b4db9aa251d39b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 28 Apr 2012 18:19:53 +0000 Subject: Allow BackupDaemon user to reset state for testing. --- bin/bbackupd/BackupDaemon.cpp | 17 +++++++++++------ 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. -- cgit v1.2.3