Pass user's database credentiasl to query runner

This commit is contained in:
Daniel García Aubert 2018-02-15 12:26:36 +01:00
parent 7a3ad2b5e0
commit b81df11a56

View File

@ -81,7 +81,15 @@ JobRunner.prototype.getQueryStatementTimeout = function(username, callback) {
JobRunner.prototype._run = function (job, query, timeout, profiler, callback) { JobRunner.prototype._run = function (job, query, timeout, profiler, callback) {
var self = this; var self = this;
self.queryRunner.run(job.data.job_id, query, job.data.user, timeout, function (err /*, result */) { const dbparams = {
pass: job.data.pass,
user: job.data.dbuser,
dbname: job.data.dbname,
port: job.data.port,
host: job.data.host
};
self.queryRunner.run(job.data.job_id, query, job.data.user, timeout, dbparams, function (err /*, result */) {
if (err) { if (err) {
if (!err.code) { if (!err.code) {
return callback(err); return callback(err);