Set the backup task progress in the task only

This commit is contained in:
Girish Ramakrishnan
2018-11-27 11:42:44 -08:00
parent e56b87766b
commit b2465dd2ee
5 changed files with 24 additions and 73 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ function doMigrate(options, caasConfig, callback) {
tasks.setProgress(tasks.TASK_MIGRATE, { percent: 10, result: 'Backing up for migration' }, NOOP_CALLBACK);
// initiate the migration in the background
backups.backupBoxAndApps({ userId: null, username: 'migrator' }, function (error) {
backups.backupBoxAndApps({ userId: null, username: 'migrator' }, (progress) => tasks.setProgress(tasks.TASK_MIGRATE, { percent: 10+progress.percent*30/100, message: progress.message }, NOOP_CALLBACK), function (error) {
if (error) return unlock(error);
debug('migrate: domain: %s size %s region %s', options.domain, options.size, options.region);