mirror of
https://github.com/openstf/stf
synced 2025-10-05 02:29:26 +02:00
Remove rutil in favor of the updated rethinkdb driver.
This commit is contained in:
parent
9604f2dde2
commit
4234bb9e34
3 changed files with 8 additions and 34 deletions
|
@ -1,5 +1,6 @@
|
|||
var r = require('rethinkdb')
|
||||
|
||||
var setup = require('./setup')
|
||||
var rutil = require('../util/rutil')
|
||||
var logger = require('../util/logger')
|
||||
var lifecycle = require('../util/lifecycle')
|
||||
|
||||
|
@ -7,7 +8,7 @@ var db = module.exports = Object.create(null)
|
|||
var log = logger.createLogger('db')
|
||||
|
||||
function connect() {
|
||||
return rutil.connect({
|
||||
return r.connect({
|
||||
// These environment variables are exposed when we --link to a
|
||||
// RethinkDB container.
|
||||
host: process.env.RETHINKDB_PORT_28015_TCP_ADDR || '127.0.0.1'
|
||||
|
@ -42,14 +43,14 @@ 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)
|
||||
return conn.close()
|
||||
})
|
||||
}
|
||||
|
||||
// Small utility for running queries without having to acquire a connection
|
||||
db.run = function(q, options) {
|
||||
return db.connect().then(function(conn) {
|
||||
return rutil.run(conn, q, options)
|
||||
return q.run(conn, options)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue