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:
parent
2dda82253d
commit
bebb3af42a
8 changed files with 37 additions and 40 deletions
|
@ -208,11 +208,14 @@ dbapi.loadDevice = function(serial) {
|
|||
return db.run(r.table('devices').get(serial))
|
||||
}
|
||||
|
||||
dbapi.updateDeviceHeartbeat = function(serial) {
|
||||
dbapi.updateProviderHeartbeat = function(channel) {
|
||||
return db.run(
|
||||
r.table('devices').get(serial).update({
|
||||
lastHeartbeatAt: r.now()
|
||||
})
|
||||
r.table('devices').getAll(channel, {
|
||||
index: 'providerChannel'
|
||||
})
|
||||
.update({
|
||||
lastHeartbeatAt: r.now()
|
||||
})
|
||||
, {
|
||||
noreply: true
|
||||
, durability: 'soft'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue