diff --git a/src/application.coffee b/src/application.coffee index 8f208e9a..b8b83ff5 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -882,7 +882,7 @@ application.initialize = -> listenToEvents() getAndApplyDeviceConfig() .then -> - knex('app').whereNot(markedForDeletion: true).select() + knex('app').whereNot(markedForDeletion: true).orWhereNull('markedForDeletion').select() .map (app) -> unlockAndStart(app) if !application.localMode and !device.shuttingDown .catch (error) -> diff --git a/src/bootstrap.coffee b/src/bootstrap.coffee index c9d7ae0c..fffd3984 100644 --- a/src/bootstrap.coffee +++ b/src/bootstrap.coffee @@ -43,6 +43,7 @@ loadPreloadedApps = -> utils.extendEnvVars(app.env, userConfig.uuid, userConfig.deviceApiKey, app.appId, app.name, app.commit) .then (extendedEnv) -> app.env = JSON.stringify(extendedEnv) + app.markedForDeletion = false _.merge(devConfig, app.config) app.config = JSON.stringify(app.config) knex('app').insert(app)