diff options
author | Chris Wilson <chris+github@qwirx.com> | 2007-03-24 23:14:27 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2007-03-24 23:14:27 +0000 |
commit | 0a27e02fbc371d46a66e128100935d488eb4d472 (patch) | |
tree | e508bcc23467f2de7e0548845303c963c465412e /bin | |
parent | bde7b631acbfd48271e88268eb7734a680a7deb6 (diff) |
Better handle a case where a force-sync command comes in immediately
after (or during) a sync, i.e. less than MinimumFileAge seconds after
the last one. In this case, just move back the syncPeriodStart by 1 second.
(refs #3, merges part if [1459])
Diffstat (limited to 'bin')
-rw-r--r-- | bin/bbackupd/BackupDaemon.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp index 894d6b1f..a24d7824 100644 --- a/bin/bbackupd/BackupDaemon.cpp +++ b/bin/bbackupd/BackupDaemon.cpp @@ -646,6 +646,18 @@ void BackupDaemon::Run2() box_time_t syncPeriodEnd = currentSyncStartTime - minimumFileAge; + if(syncPeriodStart >= syncPeriodEnd && + syncPeriodStart - syncPeriodEnd < minimumFileAge) + { + // This can happen if we receive a force-sync + // command less than minimumFileAge after + // the last sync. Deal with it by moving back + // syncPeriodStart, which should not do any + // damage. + syncPeriodStart = syncPeriodEnd - + SecondsToBoxTime(1); + } + if(syncPeriodStart >= syncPeriodEnd) { BOX_ERROR("Invalid (negative) sync period: " |