mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 00:03:28 +02:00
Set createdAt only when a device is inserted for the first time.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user