[Box Backup-commit] COMMIT r1659 - box/chris/general/bin/bbackupd
boxbackup-dev@fluffy.co.uk
boxbackup-dev@fluffy.co.uk
Tue, 15 May 2007 21:58:42 +0100
Author: chris
Date: 2007-05-15 21:58:42 +0100 (Tue, 15 May 2007)
New Revision: 1659
Modified:
box/chris/general/bin/bbackupd/BackupClientContext.cpp
Log:
Apply Gary's patch from ticket #19 to respect the server's hard limit
rather than the soft limit. This allows setting the soft limit to zero,
so that housekeeping will remove all old versions of all files (refs #19)
Modified: box/chris/general/bin/bbackupd/BackupClientContext.cpp
===================================================================
--- box/chris/general/bin/bbackupd/BackupClientContext.cpp 2007-05-15 20:56:32 UTC (rev 1658)
+++ box/chris/general/bin/bbackupd/BackupClientContext.cpp 2007-05-15 20:58:42 UTC (rev 1659)
@@ -197,16 +197,12 @@
::syslog(LOG_INFO, "Connection made, login successful");
// Check to see if there is any space available on the server
- int64_t softLimit = loginConf->GetBlocksSoftLimit();
- int64_t hardLimit = loginConf->GetBlocksHardLimit();
- // Threshold for uploading new stuff
- int64_t stopUploadThreshold = softLimit + ((hardLimit - softLimit) / 3);
- if(loginConf->GetBlocksUsed() > stopUploadThreshold)
+ if(loginConf->GetBlocksUsed() >= loginConf->GetBlocksHardLimit())
{
// no -- flag so only things like deletions happen
mStorageLimitExceeded = true;
// Log
- ::syslog(LOG_WARNING, "Exceeded storage limits on server -- not uploading changes to files");
+ ::syslog(LOG_WARNING, "Exceeded storage hard-limit on server -- not uploading changes to files");
}
}
catch(...)