mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Reap dead devices using timeouts. Previously, if a provider died without being able to clean up properly, the device would stay as a ghost.
This commit is contained in:
parent
f24e777961
commit
4896ca406e
10 changed files with 189 additions and 3 deletions
|
@ -10,8 +10,21 @@ module.exports.connect = function(options) {
|
|||
return resolver.promise
|
||||
}
|
||||
|
||||
module.exports.run = function(conn, q) {
|
||||
module.exports.close = function(conn, options) {
|
||||
var resolver = Promise.defer()
|
||||
q.run(conn, resolver.callback)
|
||||
if (!options) {
|
||||
options = {}
|
||||
}
|
||||
conn.close(options, resolver.callback)
|
||||
return resolver.promise
|
||||
}
|
||||
|
||||
module.exports.run = function(conn, q, options) {
|
||||
var resolver = Promise.defer()
|
||||
if (!options) {
|
||||
options = {}
|
||||
}
|
||||
options.connection = conn
|
||||
q.run(options, resolver.callback)
|
||||
return resolver.promise
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue