mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Add provider to device data.
This commit is contained in:
parent
389db73f08
commit
6ab252857f
6 changed files with 29 additions and 6 deletions
|
@ -26,14 +26,16 @@ module.exports.saveDeviceLog = function(serial, entry) {
|
|||
|
||||
module.exports.saveDeviceStatus = function(serial, status) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
status: status
|
||||
status: status.status
|
||||
, provider: status.provider
|
||||
, statusChangedAt: r.now()
|
||||
}))
|
||||
.then(function(stats) {
|
||||
if (stats.skipped) {
|
||||
return db.run(r.table('devices').insert({
|
||||
serial: serial
|
||||
, status: status
|
||||
, provider: status.provider
|
||||
, status: status.status
|
||||
, statusChangedAt: r.now()
|
||||
, createdAt: r.now()
|
||||
}))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue