fix: use a command timeout as fallback when user's render timeout is deactivated (render timeout === 0)

This commit is contained in:
Daniel García Aubert 2021-09-02 12:49:13 +02:00
parent 2c5dce2082
commit 277400660a
6 changed files with 14 additions and 1 deletions

View File

@ -57,6 +57,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = process.env.CARTO_SQL_API_POSTGRES_HOST || 'localhost'; module.exports.db_host = process.env.CARTO_SQL_API_POSTGRES_HOST || 'localhost';
module.exports.db_port = process.env.CARTO_SQL_API_POSTGRES_PORT || '6432'; module.exports.db_port = process.env.CARTO_SQL_API_POSTGRES_PORT || '6432';
module.exports.db_batch_port = process.env.CARTO_SQL_API_POSTGRES_BATCH_PORT || '5432'; module.exports.db_batch_port = process.env.CARTO_SQL_API_POSTGRES_BATCH_PORT || '5432';
module.exports.export_command_timeout = 5 * 60 * 1000; // 5 minutes in milliseconds
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours 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_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds
module.exports.copy_timeout = "'5h'"; module.exports.copy_timeout = "'5h'";

View File

@ -52,6 +52,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost'; module.exports.db_host = 'localhost';
module.exports.db_port = '5432'; module.exports.db_port = '5432';
module.exports.db_batch_port = '5432'; module.exports.db_batch_port = '5432';
module.exports.export_command_timeout = 5 * 60 * 1000; // 5 minutes in milliseconds
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours 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_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds
module.exports.copy_timeout = "'5h'"; module.exports.copy_timeout = "'5h'";

View File

@ -53,6 +53,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost'; module.exports.db_host = 'localhost';
module.exports.db_port = '6432'; module.exports.db_port = '6432';
module.exports.db_batch_port = '5432'; module.exports.db_batch_port = '5432';
module.exports.export_command_timeout = 5 * 60 * 1000; // 5 minutes in milliseconds
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours 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_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds
module.exports.copy_timeout = "'5h'"; module.exports.copy_timeout = "'5h'";

View File

@ -53,6 +53,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost'; module.exports.db_host = 'localhost';
module.exports.db_port = '6432'; module.exports.db_port = '6432';
module.exports.db_batch_port = '5432'; module.exports.db_batch_port = '5432';
module.exports.export_command_timeout = 5 * 60 * 1000; // 5 minutes in milliseconds
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours 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_query_timeout = 12 * 3600 * 1000; // 12 hours in milliseconds
module.exports.copy_timeout = "'5h'"; module.exports.copy_timeout = "'5h'";

View File

@ -50,6 +50,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = process.env.PGHOST || 'localhost'; module.exports.db_host = process.env.PGHOST || 'localhost';
module.exports.db_port = '5432'; module.exports.db_port = '5432';
module.exports.db_batch_port = '5432'; module.exports.db_batch_port = '5432';
module.exports.export_command_timeout = 5 * 60 * 1000; // 5 minutes in milliseconds
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
module.exports.batch_query_timeout = 5 * 1000; // 5 seconds in milliseconds module.exports.batch_query_timeout = 5 * 1000; // 5 seconds in milliseconds
module.exports.copy_timeout = "'5h'"; module.exports.copy_timeout = "'5h'";

View File

@ -58,7 +58,15 @@ OgrFormat.prototype.toOGR = function (options, outFormat, outFilename, callback)
var dbpass = dbopts.pass; var dbpass = dbopts.pass;
var dbname = dbopts.dbname; var dbname = dbopts.dbname;
var timeout = options.timeout; var timeout = 5 * 60 * 1000 // 5 minutes in milliseconds
if (Number.isFinite(global.settings.export_command_timeout)) {
timeout = global.settings.export_command_timeout;
}
if (Number.isFinite(options.timeout) && options.timeout > 0) {
timeout = options.timeout
}
var that = this; var that = this;