service-manager: Delete the correct handover complete file

Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
Pablo Carranza Velez 2018-10-17 17:38:49 +02:00
parent 047ca2ae68
commit 83b4d5878e

View File

@ -233,7 +233,7 @@ module.exports = class ServiceManager extends EventEmitter
Promise.any _.map handoverCompletePaths, (file) -> Promise.any _.map handoverCompletePaths, (file) ->
fs.statAsync(file) fs.statAsync(file)
.then -> .then ->
fs.unlinkAsync(handoverCompletePaths).catch(_.noop) fs.unlinkAsync(file).catch(_.noop)
.catch -> .catch ->
if Date.now() < deadline if Date.now() < deadline
Promise.delay(pollInterval).then(wait) Promise.delay(pollInterval).then(wait)