add backups to the database
ideally, these should be done _after_ the backup is successful and not when the backup url is generated. we had a discussion on why need backupdb to start with. Some rationale includes: 1. we can use it as a FK constraint (like make sure you delete backups when you delete app) 2. have labels for backups 3. dependancy relation from box backup to apps 4. s3 reverse sort is little painful and requires us to get all items in bulk and sort in JS (also requires us to change our backup filename format) 5. any metadata storage requires database The cons include: 1. s3 and this db go out of sync 2. db entry is useless if s3 file is missing
This commit is contained in:
@@ -644,7 +644,7 @@ function ensureBackup(callback) {
|
||||
function backupBoxWithAppBackupIds(appBackupIds, callback) {
|
||||
assert(util.isArray(appBackupIds));
|
||||
|
||||
backups.getBackupUrl(function (error, result) {
|
||||
backups.getBackupUrl(appBackupIds, function (error, result) {
|
||||
if (error && error.reason === BackupsError.EXTERNAL_ERROR) return callback(new CloudronError(CloudronError.EXTERNAL_ERROR, error.message));
|
||||
if (error) return callback(new CloudronError(CloudronError.INTERNAL_ERROR, error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user