No need for deferred in gracefullyKillWorker().

This commit is contained in:
Simo Kinnunen
2014-01-08 19:39:30 +09:00
parent f3c8572cb6
commit 3826705ccd

View File

@@ -131,17 +131,14 @@ function forceKillWorker(id) {
}
function gracefullyKillWorker(id) {
var deferred = Q.defer()
tryKillWorker(id)
return tryKillWorker(id)
.timeout(10000)
.then(deferred.resolve)
.catch(function() {
log.error('Device worker "%s" did not stop in time', id)
forceKillWorker(id).then(deferred.resolve)
return forceKillWorker(id)
.timeout(10000)
.then(deferred.resolve)
})
return deferred.promise
}
function gracefullyExit() {