mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 08:47:56 +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)
|
||||
throw err
|
||||
.then ->
|
||||
app.containerId = container.id
|
||||
device.updateState(commit: app.commit)
|
||||
logger.attach(app)
|
||||
.tap (container) ->
|
||||
# Update the app info, only if starting the container worked.
|
||||
app.containerId = container.id
|
||||
knex('app').update(app).where(appId: app.appId)
|
||||
.then (affectedRows) ->
|
||||
knex('app').insert(app) if affectedRows == 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user