mirror of
https://github.com/openstf/stf
synced 2025-10-04 02:09:32 +02:00
Set createdAt only when a device is inserted for the first time.
This commit is contained in:
parent
34bf8adb99
commit
ed106ab7c6
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,6 @@ dbapi.saveDevice = function(serial, device) {
|
||||||
, status: device.status
|
, status: device.status
|
||||||
, ready: false
|
, ready: false
|
||||||
, statusChangedAt: r.now()
|
, statusChangedAt: r.now()
|
||||||
, createdAt: r.now()
|
|
||||||
, lastHeartbeatAt: r.now()
|
, lastHeartbeatAt: r.now()
|
||||||
, reverseForwards: []
|
, reverseForwards: []
|
||||||
}
|
}
|
||||||
|
@ -136,6 +135,7 @@ dbapi.saveDevice = function(serial, device) {
|
||||||
.then(function(stats) {
|
.then(function(stats) {
|
||||||
if (stats.skipped) {
|
if (stats.skipped) {
|
||||||
data.serial = serial
|
data.serial = serial
|
||||||
|
data.createdAt = r.now()
|
||||||
return db.run(r.table('devices').insert(data))
|
return db.run(r.table('devices').insert(data))
|
||||||
}
|
}
|
||||||
return stats
|
return stats
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue