Disable per user health check
This commit is contained in:
parent
3fa74449a8
commit
d3409bdf3c
@ -32,44 +32,8 @@ HealthCheck.prototype.check = function(username, query, callback) {
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
function getDBParams(err) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
startTime = Date.now();
|
||||
self.metadataBackend.getAllUserDBParams(username, this);
|
||||
},
|
||||
function runQuery(err, dbParams) {
|
||||
result.redis.ok = !err;
|
||||
result.redis.elapsed = Date.now() - startTime;
|
||||
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
result.redis.count = Object.keys(dbParams).length;
|
||||
|
||||
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);
|
||||
},
|
||||
function handleQuery(err, resultSet) {
|
||||
result.postgresql.ok = !err;
|
||||
if (!err) {
|
||||
result.postgresql.elapsed = Date.now() - startTime;
|
||||
result.postgresql.count = resultSet.rows.length;
|
||||
}
|
||||
callback(err, result);
|
||||
function handleResult(err) {
|
||||
callback(err, result);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user