summaryrefslogtreecommitdiff
path: root/bin/bbackupd
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-12-03 14:00:16 +0000
committerChris Wilson <chris+github@qwirx.com>2014-12-03 14:00:16 +0000
commit4fbcb015379a107a36763c1bed03b08aea64d310 (patch)
treea5b0d7b77211d7a4ae6f297c720b13a99c4fd943 /bin/bbackupd
parent5a8312b5066d9b538e0466417aebf6f10135d846 (diff)
Allow users to configure the delay before retry on backup errors.
Diffstat (limited to 'bin/bbackupd')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp3
-rw-r--r--bin/bbackupd/BackupDaemon.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index 7ed5222f..713185f8 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -533,6 +533,7 @@ void BackupDaemon::Run2()
// How often to connect to the store (approximate)
mUpdateStoreInterval = SecondsToBoxTime(
conf.GetKeyValueInt("UpdateStoreInterval"));
+ mBackupErrorDelay = conf.GetKeyValueInt("BackupErrorDelay");
// But are we connecting automatically?
bool automaticBackup = conf.GetKeyValueBool("AutomaticBackup");
@@ -784,7 +785,7 @@ std::auto_ptr<BackupClientContext> BackupDaemon::RunSyncNowWithExceptionHandling
"), reset state and waiting to retry...");
::sleep(10);
mNextSyncTime = GetCurrentBoxTime() +
- SecondsToBoxTime(BACKUP_ERROR_RETRY_SECONDS) +
+ SecondsToBoxTime(mBackupErrorDelay) +
Random::RandomInt(mUpdateStoreInterval >>
SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY);
}
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index d5e812af..a6cb8d46 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -226,7 +226,8 @@ private:
bool mStorageLimitExceeded;
bool mReadErrorsOnFilesystemObjects;
box_time_t mLastSyncTime, mNextSyncTime;
- box_time_t mCurrentSyncStartTime, mUpdateStoreInterval;
+ box_time_t mCurrentSyncStartTime, mUpdateStoreInterval,
+ mBackupErrorDelay;
TLSContext mTlsContext;
bool mDeleteStoreObjectInfoFile;
bool mDoSyncForcedByPreviousSyncError;