mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-31 16:35:23 +00:00
Merge pull request #782 from balena-io/fix-delete-old-apps
fix: When setting target state, delete old apps from the same source
This commit is contained in:
commit
0d7335bdee
@ -742,6 +742,8 @@ module.exports = class ApplicationManager extends EventEmitter
|
||||
.tap (appsForDB) =>
|
||||
Promise.map appsForDB, (app) =>
|
||||
@db.upsertModel('app', app, { appId: app.appId }, trx)
|
||||
.then (appsForDB) ->
|
||||
trx('app').where({ source }).whereNotIn('appId', _.map(appsForDB, 'appId')).del()
|
||||
.then =>
|
||||
@proxyvisor.setTargetInTransaction(dependent, trx)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user