mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Don't rely on lucky timings when sending messages from the provider.
This commit is contained in:
@@ -84,6 +84,12 @@ dbapi.setDeviceAbsent = function(serial) {
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.setDeviceChannel = function(serial, channel) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
channel: channel
|
||||
}))
|
||||
}
|
||||
|
||||
dbapi.saveDeviceIdentity = function(serial, identity) {
|
||||
return db.run(r.table('devices').get(serial).update({
|
||||
platform: identity.platform
|
||||
@@ -105,16 +111,4 @@ dbapi.loadDevice = function(serial) {
|
||||
return db.run(r.table('devices').get(serial))
|
||||
}
|
||||
|
||||
dbapi.ensureDeviceSaved = function(serial) {
|
||||
return dbapi.loadDevice(serial)
|
||||
.then(function(device) {
|
||||
if (!device) {
|
||||
return Promise.delay(100).then(function() {
|
||||
return dbapi.loadDevice(serial)
|
||||
})
|
||||
}
|
||||
return device
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = dbapi
|
||||
|
||||
Reference in New Issue
Block a user