mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 09:53:21 +02:00
Send heartbeats from the provider. This keeps unauthorized and offline devices present as well, which is what we want. This also greatly reduces the number of queries to rethinkdb.
This commit is contained in:
10
lib/cli.js
10
lib/cli.js
@@ -46,6 +46,10 @@ program
|
||||
.option('-r, --storage-url <url>'
|
||||
, 'URL to storage client'
|
||||
, String)
|
||||
.option('--heartbeat-interval <ms>'
|
||||
, 'heartbeat interval'
|
||||
, Number
|
||||
, 10000)
|
||||
.action(function() {
|
||||
var serials = cliutil.allUnknownArgs(arguments)
|
||||
, options = cliutil.lastArg(arguments)
|
||||
@@ -63,6 +67,7 @@ program
|
||||
require('./roles/provider')({
|
||||
name: options.name
|
||||
, killTimeout: 10000
|
||||
, heartbeatInterval: options.heartbeatInterval
|
||||
, ports: cliutil.range(options.minPort, options.maxPort)
|
||||
, filter: function(device) {
|
||||
return serials.length === 0 || serials.indexOf(device.id) !== -1
|
||||
@@ -106,10 +111,6 @@ program
|
||||
, 'public ip for global access'
|
||||
, String
|
||||
, ip())
|
||||
.option('--heartbeat-interval <ms>'
|
||||
, 'heartbeat interval'
|
||||
, Number
|
||||
, 10000)
|
||||
.option('-t, --group-timeout <seconds>'
|
||||
, 'group timeout'
|
||||
, Number
|
||||
@@ -143,7 +144,6 @@ program
|
||||
sub: options.connectSub
|
||||
, push: options.connectPush
|
||||
}
|
||||
, heartbeatInterval: options.heartbeatInterval
|
||||
, groupTimeout: options.groupTimeout * 1000 // change to ms
|
||||
, storageUrl: options.storageUrl
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user