1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 18:29:17 +02:00

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) { function gracefullyKillWorker(id) {
var deferred = Q.defer() return tryKillWorker(id)
tryKillWorker(id)
.timeout(10000) .timeout(10000)
.then(deferred.resolve)
.catch(function() { .catch(function() {
log.error('Device worker "%s" did not stop in time', id) 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() { function gracefullyExit() {