Make force update as task arg

This commit is contained in:
Girish Ramakrishnan
2019-08-29 10:59:05 -07:00
parent f3008064e4
commit c98f625c4c
3 changed files with 7 additions and 9 deletions

View File

@@ -902,7 +902,10 @@ function update(appId, data, auditSource, callback) {
downloadManifest(data.appStoreId, data.manifest, function (error, appStoreId, manifest) {
if (error) return callback(error);
var updateConfig = { };
var updateConfig = {
skipNotification: data.force,
skipBackup: data.force
};
error = manifestFormat.parse(manifest);
if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Manifest error:' + error.message));
@@ -948,7 +951,7 @@ function update(appId, data, auditSource, callback) {
updateConfig.memoryLimit = updateConfig.manifest.memoryLimit;
}
appdb.setInstallationCommand(appId, data.force ? appdb.ISTATE_PENDING_FORCE_UPDATE : appdb.ISTATE_PENDING_UPDATE, { }, function (error) {
appdb.setInstallationCommand(appId, appdb.ISTATE_PENDING_UPDATE, { }, function (error) {
if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new AppsError(AppsError.BAD_STATE)); // might be a bad guess
if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error));