mirror of
https://github.com/openstf/stf
synced 2025-10-03 17:59:28 +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
|
||||
, ready: false
|
||||
, statusChangedAt: r.now()
|
||||
, createdAt: r.now()
|
||||
, lastHeartbeatAt: r.now()
|
||||
, reverseForwards: []
|
||||
}
|
||||
|
@ -136,6 +135,7 @@ dbapi.saveDevice = function(serial, device) {
|
|||
.then(function(stats) {
|
||||
if (stats.skipped) {
|
||||
data.serial = serial
|
||||
data.createdAt = r.now()
|
||||
return db.run(r.table('devices').insert(data))
|
||||
}
|
||||
return stats
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue