Proper db params object
This commit is contained in:
parent
0d5424c74f
commit
5f2fb65095
@ -1,4 +1,5 @@
|
||||
var Step = require('step');
|
||||
var Step = require('step'),
|
||||
_ = require('underscore');
|
||||
|
||||
function HealthCheck(metadataBackend, psqlClass) {
|
||||
this.metadataBackend = metadataBackend;
|
||||
@ -30,7 +31,17 @@ HealthCheck.prototype.check = function(username, query, callback) {
|
||||
|
||||
result.redis.count = Object.keys(dbParams).length;
|
||||
|
||||
var psql = new self.psqlClass(dbParams);
|
||||
var psql = new self.psqlClass({
|
||||
host: dbParams.dbhost,
|
||||
port: global.settings.db_port,
|
||||
dbname: dbParams.dbname,
|
||||
user: _.template(global.settings.db_user, {user_id: dbParams.dbuser}),
|
||||
pass: _.template(global.settings.db_user_pass, {
|
||||
user_id: dbParams.dbuser,
|
||||
user_password: dbParams.dbpass
|
||||
})
|
||||
});
|
||||
|
||||
startTime = Date.now();
|
||||
psql.query(query, this);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user