1
0
Fork 0
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:
Simo Kinnunen 2014-01-29 20:54:04 +09:00
parent 389db73f08
commit 6ab252857f
6 changed files with 29 additions and 6 deletions

View file

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