Skip to content

Commit

Permalink
ota: clean up images during lock acquired procedure (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas authored and yorkie committed Oct 21, 2019
1 parent 279519a commit 2daa2fb
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions runtime/services/otad/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,24 @@ function runInCurrentContext (delegate, callback) {
unlockProc = unlock
cb()
},
cb => delegate.prelude(cb),
(cb, result) => {
if (!result) {
return compose.Break(null)
}
cb()
},
/** actual procedure, shall skip if prepare failed */
cb => doRun(cb)
cb =>
compose([
cb => delegate.prelude(cb),
(cb, result) => {
if (!result) {
return compose.Break(null)
}
cb()
},
/** actual procedure, shall skip if prepare failed */
cb => doRun(cb)
], (err, info) => {
if (err) {
common.cleanup(() => cb(err))
return
}
cb(null, info)
})
], (err, info) => {
logger.info('ota unlocking proc lock.')
if (typeof unlockProc !== 'function') {
Expand Down

0 comments on commit 2daa2fb

Please sign in to comment.