1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +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:
Simo Kinnunen 2014-06-02 14:51:26 +09:00
parent 2dda82253d
commit bebb3af42a
8 changed files with 37 additions and 40 deletions

View file

@ -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
})