make backup progress work for per-app backups

This commit is contained in:
Girish Ramakrishnan
2017-09-28 11:12:12 -07:00
parent 404a019c56
commit 565c8445e1
5 changed files with 29 additions and 11 deletions
+2 -5
View File
@@ -479,11 +479,10 @@ function backup(app, callback) {
assert.strictEqual(typeof app, 'object');
assert.strictEqual(typeof callback, 'function');
var prefix = (new Date()).toISOString().replace(/[T.]/g, '-').replace(/[:Z]/g,'');
async.series([
updateApp.bind(null, app, { installationProgress: '10, Backing up' }),
backups.backupApp.bind(null, app, app.manifest, prefix),
backups.backupApp.bind(null, app, app.manifest),
// done!
function (callback) {
@@ -607,11 +606,9 @@ function update(app, callback) {
function (next) {
if (app.installationState === appdb.ISTATE_PENDING_FORCE_UPDATE) return next(null);
var prefix = (new Date()).toISOString().replace(/[T.]/g, '-').replace(/[:Z]/g,'');
async.series([
updateApp.bind(null, app, { installationProgress: '30, Backing up app' }),
backups.backupApp.bind(null, app, app.oldConfig.manifest, prefix)
backups.backupApp.bind(null, app, app.oldConfig.manifest)
], next);
},