repair: Use backupId only if passed in via REST API
This commit is contained in:
@@ -1407,8 +1407,10 @@ function repair(appId, data, auditSource, callback) {
|
||||
|
||||
tasks.get(appError.taskId || '', function (error, task) {
|
||||
let args = !error ? task.args[1] : {}; // the first argument is the app id
|
||||
args.restoreConfig = data.backupId ? { backupId: data.backupId, backupFormat: data.backupFormat, oldManifest: app.manifest } : null; // when null, apptask simply reinstalls
|
||||
args.overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false;
|
||||
if ('backupId' in data) {
|
||||
args.restoreConfig = data.backupId ? { backupId: data.backupId, backupFormat: data.backupFormat, oldManifest: app.manifest } : null; // when null, apptask simply reinstalls
|
||||
}
|
||||
if ('overwriteDns' in data) args.overwriteDns = data.overwriteDns;
|
||||
|
||||
// create a new task instead of updating the old one, since it helps tracking
|
||||
addTask(appId, newState, { args, values, requiredState: exports.ISTATE_ERROR }, function (error, result) {
|
||||
|
||||
Reference in New Issue
Block a user