mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 12:53:31 +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:
@@ -362,6 +362,19 @@ module.exports = function(options) {
|
||||
lifecycle.share('Tracker', tracker)
|
||||
})
|
||||
|
||||
// This keeps the devices "present" in the database. It relies on the
|
||||
// provider channel changing on every run so that we never match old
|
||||
// devices.
|
||||
;(function heartbeat() {
|
||||
push.send([
|
||||
wireutil.heartbeat
|
||||
, wireutil.envelope(new wire.ProviderHeartbeatMessage(
|
||||
solo
|
||||
))
|
||||
])
|
||||
setTimeout(heartbeat, options.heartbeatInterval)
|
||||
})()
|
||||
|
||||
lifecycle.observe(function() {
|
||||
clearTimeout(totalsTimer)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user