summaryrefslogtreecommitdiff
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
parent5a8312b5066d9b538e0466417aebf6f10135d846 (diff)
Allow users to configure the delay before retry on backup errors.
-rw-r--r--bin/bbackupd/BackupDaemon.cpp3
-rw-r--r--bin/bbackupd/BackupDaemon.h3
-rw-r--r--lib/backupclient/BackupDaemonConfigVerify.cpp3
3 files changed, 7 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;
diff --git a/lib/backupclient/BackupDaemonConfigVerify.cpp b/lib/backupclient/BackupDaemonConfigVerify.cpp
index 8f8746b5..ffcb3403 100644
--- a/lib/backupclient/BackupDaemonConfigVerify.cpp
+++ b/lib/backupclient/BackupDaemonConfigVerify.cpp
@@ -11,6 +11,7 @@
#include "BackupDaemonConfigVerify.h"
#include "Daemon.h"
#include "BoxPortsAndFiles.h"
+#include "BackupConstants.h"
#include "MemLeakFindOn.h"
@@ -68,6 +69,8 @@ static const ConfigurationVerifyKey verifyrootkeys[] =
ConfigTest_Exists | ConfigTest_IsUint32),
ConfigurationVerifyKey("UpdateStoreInterval",
ConfigTest_Exists | ConfigTest_IsInt),
+ ConfigurationVerifyKey("BackupErrorDelay",
+ ConfigTest_Exists | ConfigTest_IsInt, BACKUP_ERROR_RETRY_SECONDS),
ConfigurationVerifyKey("MinimumFileAge",
ConfigTest_Exists | ConfigTest_IsInt),
ConfigurationVerifyKey("MaxUploadWait",