mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-20 09:46:19 +00:00
Ensure preloaded apps are properly loaded by setting their internal markedForDeletion to false, and run apps that have it set to null
Currently preloaded apps don't run because their markedForDeletion field in the database is null. In this commit we set it to false, and we also change the startup check to also run any apps that have markedForDeletion as null (which should now never happen, but is still good as a backup plan in case something else fails and to avoid regressions). Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
parent
3f198fc6aa
commit
a87c6682a2
@ -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) ->
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user