Disabled statement timeout bypassing pgbouncer connection
This commit is contained in:
parent
30d0b2906b
commit
f41c43aa38
@ -26,13 +26,19 @@ JobRunner.prototype.run = function (jobId) {
|
||||
|
||||
jobBackend.setRunning(job);
|
||||
|
||||
pg.eventedQuery(job.query, function (err, query) {
|
||||
query.on('error', function (err) {
|
||||
jobBackend.setFailed(job, err);
|
||||
});
|
||||
pg.query('SET statement_timeout=0', function(err) {
|
||||
if(err) {
|
||||
return jobBackend.setFailed(job, err);
|
||||
}
|
||||
|
||||
query.on('end', function () {
|
||||
jobBackend.setDone(job);
|
||||
pg.eventedQuery(job.query, function (err, query /* , queryCanceller */) {
|
||||
query.on('error', function (err) {
|
||||
jobBackend.setFailed(job, err);
|
||||
});
|
||||
|
||||
query.on('end', function () {
|
||||
jobBackend.setDone(job);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -22,7 +22,7 @@ UserDatabaseMetadataService.prototype.parseMetadaToDatabase = function (userData
|
||||
var dbParams = userDatabaseMetadata;
|
||||
|
||||
var dbopts = {
|
||||
port: global.settings.db_port,
|
||||
port: global.settings.db_batch_port,
|
||||
pass: global.settings.db_pubuser_pass
|
||||
};
|
||||
|
||||
|
@ -28,6 +28,7 @@ module.exports.db_pubuser = 'publicuser';
|
||||
module.exports.db_pubuser_pass = 'public';
|
||||
module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '5432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
// NOTE: not used by OGR-mediated accesses
|
||||
|
@ -29,6 +29,7 @@ module.exports.db_pubuser = 'publicuser';
|
||||
module.exports.db_pubuser_pass = 'public';
|
||||
module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '6432';
|
||||
module.exports.db_batch_port = '6432';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
// NOTE: not used by OGR-mediated accesses
|
||||
|
@ -29,6 +29,7 @@ module.exports.db_pubuser = 'publicuser';
|
||||
module.exports.db_pubuser_pass = 'public';
|
||||
module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '6432';
|
||||
module.exports.db_batch_port = '6432';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
// NOTE: not used by OGR-mediated accesses
|
||||
|
@ -26,6 +26,7 @@ module.exports.db_pubuser = 'testpublicuser';
|
||||
module.exports.db_pubuser_pass = 'public';
|
||||
module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '5432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
// NOTE: not used by OGR-mediated accesses
|
||||
|
@ -18,10 +18,9 @@ describe('batch', function() {
|
||||
var jobPublisher = new JobPublisher();
|
||||
var jobBackend = new JobBackend(metadataBackend);
|
||||
var username = 'vizzuality';
|
||||
var sql = "select * from private_table limit 1";
|
||||
var sql = "select * into batch_table from (select * from private_table limit 1) as job";
|
||||
var _jobId = '';
|
||||
|
||||
|
||||
var userDatabaseMetadataService = new UserDatabaseMetadataService(metadataBackend);
|
||||
|
||||
userDatabaseMetadataService.getUserMetadata(username, function (err, userDatabaseMetadata) {
|
||||
|
Loading…
Reference in New Issue
Block a user