Use same timestamp for archive and config
This fixes a very curious case: 1. App has backup. 2. App dies. 3. Box backs up. This make it reuse the backup. But it generates wrong config file timestamp. 4. Box cannot update anymore. This is because the backup of app fails - it tries to reuse the backup and that fails with AccessDenied because the timestamp above is wrong!
This commit is contained in:
+3
-2
@@ -189,8 +189,9 @@ function copyLastBackup(app, callback) {
|
||||
assert.strictEqual(typeof app.lastBackupId, 'string');
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var toFilenameArchive = util.format('appbackup_%s_%s-v%s.tar.gz', app.id, (new Date()).toISOString(), app.manifest.version);
|
||||
var toFilenameConfig = util.format('appbackup_%s_%s-v%s.json', app.id, (new Date()).toISOString(), app.manifest.version);
|
||||
var now = new Date();
|
||||
var toFilenameArchive = util.format('appbackup_%s_%s-v%s.tar.gz', app.id, now.toISOString(), app.manifest.version);
|
||||
var toFilenameConfig = util.format('appbackup_%s_%s-v%s.json', app.id, now.toISOString(), app.manifest.version);
|
||||
|
||||
settings.getBackupConfig(function (error, backupConfig) {
|
||||
if (error) return callback(new BackupsError(BackupsError.INTERNAL_ERROR, error));
|
||||
|
||||
Reference in New Issue
Block a user