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:
Simo Kinnunen
2014-02-25 20:45:29 +09:00
parent f24e777961
commit 4896ca406e
10 changed files with 189 additions and 3 deletions

View File

@@ -33,8 +33,15 @@ db.connect = (function() {
}
})()
// Close connection, we don't really care if it hasn't been created yet or not
db.close = function() {
return db.connect().then(function(conn) {
return rutil.close(conn)
})
}
// Small utility for running queries without having to acquire a connection
db.run = function(q) {
db.run = function(q, options) {
return db.connect().then(function(conn) {
return rutil.run(conn, q)
})