mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 00:45:23 +00:00
Fix double app start (app.id = null after kill)
This commit is contained in:
parent
2f09413096
commit
c250ff483c
@ -109,6 +109,8 @@ exports.kill = kill = (app) ->
|
||||
.tap ->
|
||||
logSystemEvent(logTypes.stopAppSuccess, app)
|
||||
knex('app').where('id', app.id).delete()
|
||||
.tap ->
|
||||
app.id = null
|
||||
.catch (err) ->
|
||||
logSystemEvent(logTypes.stopAppError, app, err)
|
||||
throw err
|
||||
@ -261,7 +263,7 @@ exports.update = update = ->
|
||||
Promise.all([
|
||||
knex('config').select('value').where(key: 'apiKey')
|
||||
knex('config').select('value').where(key: 'uuid')
|
||||
knex('app').select()
|
||||
Promise.using(lockUpdates(), -> knex('app').select())
|
||||
])
|
||||
.then ([ [ apiKey ], [ uuid ], apps ]) ->
|
||||
apiKey = apiKey.value
|
||||
|
Loading…
x
Reference in New Issue
Block a user