Get the primary backup target during box update
This commit is contained in:
+4
-1
@@ -176,7 +176,10 @@ async function updateBox(boxUpdateInfo, options, progressCallback) {
|
||||
if (!options.skipBackup) {
|
||||
progressCallback({ percent: 10, message: 'Backing up' });
|
||||
|
||||
await backuptask.fullBackup({ preserveSecs: 3*7*24*60*60 }, (progress) => progressCallback({ percent: 10+progress.percent*70/100, message: progress.message }));
|
||||
const target = await backupTargets.getPrimary();
|
||||
if (!target) throw new BoxError(BoxError.BAD_STATE, 'no default backup target');
|
||||
|
||||
await backuptask.fullBackup(target.id, { preserveSecs: 3*7*24*60*60 }, (progress) => progressCallback({ percent: 10+progress.percent*70/100, message: progress.message }));
|
||||
|
||||
await checkFreeDiskSpace(2*1024*1024*1024); // check again in case backup is in same disk
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user