diff options
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 3 | ||||
-rw-r--r-- | bin/bbackupd/BackupDaemon.h | 3 | ||||
-rw-r--r-- | lib/backupclient/BackupDaemonConfigVerify.cpp | 3 |
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", |