summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2014-08-24 20:31:46 +0000
committerChris Wilson <chris+github@qwirx.com>2014-08-24 20:31:46 +0000
commit1f1d8355ad73eb9c0ab9aaeb069a21aecee78d6f (patch)
tree18894ab96968faa022dbd156c66ac1fb0df2e2ba /bin
parent6f05cd831394335c32c6eebc4f4da7454302bbc9 (diff)
Fix timing issue with bbackupd test for recovery after error.
For some reason the timing changed and the test was no longer waiting for the same length of time as bbackupd, causing it to fail. Merged back changes from the test refactor branch to reduce diffs.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index bb022e44..0fca634c 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -61,6 +61,7 @@
#include "BackupClientFileAttributes.h"
#include "BackupClientInodeToIDMap.h"
#include "BackupClientMakeExcludeList.h"
+#include "BackupConstants.h"
#include "BackupDaemon.h"
#include "BackupDaemonConfigVerify.h"
#include "BackupStoreConstants.h"
@@ -574,6 +575,7 @@ void BackupDaemon::Run2()
box_time_t currentTime = GetCurrentBoxTime();
box_time_t requiredDelay = (mNextSyncTime < currentTime)
? (0) : (mNextSyncTime - currentTime);
+ mNextSyncTime = currentTime + requiredDelay;
if (mDoSyncForcedByPreviousSyncError)
{
@@ -670,7 +672,7 @@ void BackupDaemon::Run2()
if(d > 0)
{
// Script has asked for a delay
- mNextSyncTime = GetCurrentBoxTime() +
+ mNextSyncTime = GetCurrentBoxTime() +
SecondsToBoxTime(d);
BOX_INFO("Impending backup stopped by "
"SyncAllowScript, next attempt "
@@ -779,9 +781,9 @@ void BackupDaemon::RunSyncNowWithExceptionHandling()
" " << errorCode << "/" << errorSubCode <<
"), reset state and waiting to retry...");
::sleep(10);
- mNextSyncTime = mCurrentSyncStartTime +
- SecondsToBoxTime(100) +
- Random::RandomInt(mUpdateStoreInterval >>
+ mNextSyncTime = GetCurrentBoxTime() +
+ SecondsToBoxTime(BACKUP_ERROR_RETRY_SECONDS) +
+ Random::RandomInt(mUpdateStoreInterval >>
SYNC_PERIOD_RANDOM_EXTRA_TIME_SHIFT_BY);
}
}