mirror of
https://github.com/openstf/stf
synced 2025-10-06 03:50:04 +02:00
Don't try to restart if we're stopping.
This commit is contained in:
parent
e10a58c881
commit
e4b701df5d
1 changed files with 15 additions and 10 deletions
|
@ -104,6 +104,7 @@ module.exports = function(options) {
|
|||
log.info('Found device "%s" (%s)', device.id, device.type)
|
||||
|
||||
var privateTracker = new events.EventEmitter()
|
||||
, willStop = false
|
||||
, timer
|
||||
, worker
|
||||
|
||||
|
@ -209,9 +210,11 @@ module.exports = function(options) {
|
|||
switch (device.type) {
|
||||
case 'device':
|
||||
case 'emulator':
|
||||
willStop = false
|
||||
timer = setTimeout(work, 100)
|
||||
break
|
||||
default:
|
||||
willStop = true
|
||||
timer = setTimeout(stop, 100)
|
||||
break
|
||||
}
|
||||
|
@ -230,6 +233,7 @@ module.exports = function(options) {
|
|||
worker = null
|
||||
})
|
||||
.catch(procutil.ExitError, function(err) {
|
||||
if (!willStop) {
|
||||
log.error(
|
||||
'Device worker "%s" died with code %s'
|
||||
, device.id
|
||||
|
@ -240,6 +244,7 @@ module.exports = function(options) {
|
|||
.then(function() {
|
||||
return work()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue