s3: add progress detail

this is a bit of a hack and we should add another way to set the progress
(maybe via backups.setProgress or via a progress callback). this is because
some methods like removeDir can be called from backuptask and from box code.
This commit is contained in:
Girish Ramakrishnan
2017-10-01 17:35:44 -07:00
parent f9973e765c
commit 0f543e6703
3 changed files with 6 additions and 8 deletions

View File

@@ -683,10 +683,8 @@ function backupBoxAndApps(auditSource, callback) {
apps.getAll(function (error, allApps) {
if (error) return callback(new BackupsError(BackupsError.INTERNAL_ERROR, error));
var processed = 0;
var step = 100/(allApps.length+1);
progress.set(progress.BACKUP, Math.min(step * processed, 5), '');
var processed = 1;
var step = 100/(allApps.length+2);
async.mapSeries(allApps, function iterator(app, iteratorCallback) {
progress.set(progress.BACKUP, step * processed, 'Backing up ' + (app.altDomain || config.appFqdn(app.location)));