mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-08 04:10:28 +00:00
Merge pull request #40 from resin-io/assign-containerid-before-logger-attach
Bugfix: assign app.containerId before attaching logger
This commit is contained in:
commit
7f9683182e
@ -225,11 +225,11 @@ application.start = start = (app) ->
|
|||||||
logSystemEvent(logTypes.startAppError, app, err)
|
logSystemEvent(logTypes.startAppError, app, err)
|
||||||
throw err
|
throw err
|
||||||
.then ->
|
.then ->
|
||||||
|
app.containerId = container.id
|
||||||
device.updateState(commit: app.commit)
|
device.updateState(commit: app.commit)
|
||||||
logger.attach(app)
|
logger.attach(app)
|
||||||
.tap (container) ->
|
.tap (container) ->
|
||||||
# Update the app info, only if starting the container worked.
|
# Update the app info, only if starting the container worked.
|
||||||
app.containerId = container.id
|
|
||||||
knex('app').update(app).where(appId: app.appId)
|
knex('app').update(app).where(appId: app.appId)
|
||||||
.then (affectedRows) ->
|
.then (affectedRows) ->
|
||||||
knex('app').insert(app) if affectedRows == 0
|
knex('app').insert(app) if affectedRows == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user