Improved naming for jobs TTL constant

This commit is contained in:
Daniel García Aubert 2016-08-30 10:11:49 +02:00
parent 01d1866e11
commit 2932227e8b
5 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ var queue = require('queue-async');
var debug = require('./util/debug')('job-backend');
var REDIS_PREFIX = 'batch:jobs:';
var REDIS_DB = 5;
var JOBS_TTL_IN_SECONDS = global.settings.jobs_ttl_in_seconds || 48 * 3600; // 48 hours
var FINISHED_JOBS_TTL_IN_SECONDS = global.settings.finished_jobs_ttl_in_seconds || 48 * 3600; // 48 hours
var jobStatus = require('./job_status');
var finalStatus = [
jobStatus.CANCELLED,
@ -178,7 +178,7 @@ JobBackend.prototype.setTTL = function (job, callback) {
return callback();
}
self.metadataBackend.redisCmd(REDIS_DB, 'EXPIRE', [ redisKey, JOBS_TTL_IN_SECONDS ], callback);
self.metadataBackend.redisCmd(REDIS_DB, 'EXPIRE', [ redisKey, FINISHED_JOBS_TTL_IN_SECONDS ], callback);
};
JobBackend.prototype.list = function (user, callback) {

View File

@ -29,7 +29,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost';
module.exports.db_port = '5432';
module.exports.db_batch_port = '5432';
module.exports.jobs_ttl_in_seconds = 48 * 3600; // 48 hours
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
// Max database connections in the pool
// Subsequent connections will wait for a free slot.
// NOTE: not used by OGR-mediated accesses

View File

@ -30,7 +30,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost';
module.exports.db_port = '6432';
module.exports.db_batch_port = '5432';
module.exports.jobs_ttl_in_seconds = 48 * 3600; // 48 hours
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
// Max database connections in the pool
// Subsequent connections will wait for a free slot.i
// NOTE: not used by OGR-mediated accesses

View File

@ -30,7 +30,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost';
module.exports.db_port = '6432';
module.exports.db_batch_port = '5432';
module.exports.jobs_ttl_in_seconds = 48 * 3600; // 48 hours
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
// Max database connections in the pool
// Subsequent connections will wait for a free slot.
// NOTE: not used by OGR-mediated accesses

View File

@ -27,7 +27,7 @@ module.exports.db_pubuser_pass = 'public';
module.exports.db_host = 'localhost';
module.exports.db_port = '5432';
module.exports.db_batch_port = '5432';
module.exports.jobs_ttl_in_seconds = 48 * 3600; // 48 hours
module.exports.finished_jobs_ttl_in_seconds = 2 * 3600; // 2 hours
// Max database connections in the pool
// Subsequent connections will wait for a free slot.
// NOTE: not used by OGR-mediated accesses