mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user