Add option to skip backup before update

(cherry picked from commit a7d2098f09)
This commit is contained in:
Girish Ramakrishnan
2019-05-12 13:28:53 -07:00
parent 1e0ec75f0a
commit e0c531564c
4 changed files with 18 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ function update(req, res, next) {
debug('triggering update');
// this only initiates the update, progress can be checked via the progress route
updater.updateToLatest(auditSource.SYSADMIN, function (error, taskId) {
updater.updateToLatest({ skipBackup: false }, auditSource.SYSADMIN, function (error, taskId) {
if (error && error.reason === UpdaterError.ALREADY_UPTODATE) return next(new HttpError(422, error.message));
if (error && error.reason === UpdaterError.BAD_STATE) return next(new HttpError(409, error.message));
if (error) return next(new HttpError(500, error));