mirror of
https://github.com/openstf/stf
synced 2025-10-03 17:59:28 +02:00
React to device reboots more gracefully. Previously, the provider would attempt to restart the worker as soon as an essential service died, even if the device was soon released after. Now that doesn't happen.
This commit is contained in:
parent
8db22952bf
commit
816904b9bb
2 changed files with 106 additions and 27 deletions
|
@ -24,6 +24,10 @@ program
|
|||
, 'name (or os.hostname())'
|
||||
, String
|
||||
, os.hostname())
|
||||
.option('-t, --restart-threshold <ms>'
|
||||
, 'restart worker only if it stays alive for longer than this'
|
||||
, Number
|
||||
, 10000)
|
||||
.action(function() {
|
||||
var serials = cliutil.allUnknownArgs(arguments)
|
||||
, options = cliutil.lastArg(arguments)
|
||||
|
@ -37,6 +41,9 @@ program
|
|||
|
||||
require('./roles/provider')({
|
||||
name: options.name
|
||||
, restartThreshold: options.restartThreshold
|
||||
, restartTimeout: 1000
|
||||
, killTimeout: 10000
|
||||
, filter: function(device) {
|
||||
return serials.length === 0 || serials.indexOf(device.id) !== -1
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue