mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +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:
@@ -33,6 +33,10 @@ module.exports = function(options) {
|
||||
})
|
||||
|
||||
devDealer.on('message', wirerouter()
|
||||
// Provider messages
|
||||
.on(wire.ProviderHeartbeatMessage, function(channel, message) {
|
||||
dbapi.updateProviderHeartbeat(message.channel)
|
||||
})
|
||||
// Initial device message
|
||||
.on(wire.DevicePresentMessage, function(channel, message, data) {
|
||||
dbapi.saveDevice(message.serial, message)
|
||||
@@ -66,9 +70,6 @@ module.exports = function(options) {
|
||||
})
|
||||
})
|
||||
// Worker messages
|
||||
.on(wire.DeviceHeartbeatMessage, function(channel, message) {
|
||||
dbapi.updateDeviceHeartbeat(message.serial)
|
||||
})
|
||||
.on(wire.JoinGroupMessage, function(channel, message, data) {
|
||||
dbapi.setDeviceOwner(message.serial, message.owner)
|
||||
appDealer.send([channel, data])
|
||||
|
||||
Reference in New Issue
Block a user