Merge pull request #357 from CartoDB/limit-batch-queries
set limit to batch queries to 12h
This commit is contained in:
commit
aa19120495
3
NEWS.md
3
NEWS.md
@ -1,6 +1,9 @@
|
||||
1.37.2 - 2016-mm-dd
|
||||
-------------------
|
||||
|
||||
Announcements:
|
||||
* limited batch queries to 12 hours
|
||||
|
||||
|
||||
1.37.1 - 2016-10-05
|
||||
-------------------
|
||||
|
@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
var PSQL = require('cartodb-psql');
|
||||
var BATCH_QUERY_TIMEOUT = global.settings.batch_query_timeout || 12 * 3600 * 1000; // 12 hours in millisecond
|
||||
|
||||
function QueryRunner(userDatabaseMetadataService) {
|
||||
this.userDatabaseMetadataService = userDatabaseMetadataService;
|
||||
@ -16,7 +17,7 @@ QueryRunner.prototype.run = function (job_id, sql, user, callback) {
|
||||
|
||||
var pg = new PSQL(userDatabaseMetadata, {}, { destroyOnError: true });
|
||||
|
||||
pg.query('SET statement_timeout=0', function (err) {
|
||||
pg.query('SET statement_timeout=' + BATCH_QUERY_TIMEOUT, function (err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '5432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
|
||||
module.exports.batch_query_timeout || 12 * 3600 * 1000; // 12 hours in milliseconds
|
||||
module.exports.batch_log_filename = 'logs/batch-queries.log';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
|
@ -31,6 +31,7 @@ module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '6432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
|
||||
module.exports.batch_query_timeout || 12 * 3600 * 1000; // 12 hours in milliseconds
|
||||
module.exports.batch_log_filename = 'logs/batch-queries.log';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.i
|
||||
|
@ -31,6 +31,7 @@ module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '6432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
|
||||
module.exports.batch_query_timeout || 12 * 3600 * 1000; // 12 hours in milliseconds
|
||||
module.exports.batch_log_filename = 'logs/batch-queries.log';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
|
@ -28,6 +28,7 @@ module.exports.db_host = 'localhost';
|
||||
module.exports.db_port = '5432';
|
||||
module.exports.db_batch_port = '5432';
|
||||
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
|
||||
module.exports.batch_query_timeout || 12 * 3600 * 1000; // 12 hours in milliseconds
|
||||
module.exports.batch_log_filename = 'logs/batch-queries.log';
|
||||
// Max database connections in the pool
|
||||
// Subsequent connections will wait for a free slot.
|
||||
|
Loading…
Reference in New Issue
Block a user