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:
parent
f3c8572cb6
commit
3826705ccd
1 changed files with 4 additions and 7 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue