From 678d653ee9e3644ff69e3f7e571d63d546fc7f70 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Thu, 13 Feb 2014 15:44:54 +0100 Subject: [PATCH] Allow configuring TTL of mapConfigs via "mapConfigTTL" --- NEWS.md | 1 + config/environments/development.js.example | 5 +++++ config/environments/production.js.example | 5 +++++ config/environments/staging.js.example | 5 +++++ config/environments/test.js.example | 5 +++++ lib/cartodb/server_options.js | 4 ++-- 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 66b9078a..b23b4d38 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,7 @@ Enhancements: * Use single redis pooler for torque and grainstore * Reduce cost of garbage collection for localized resources * Allow limiting number of templates for each user (#136) + * Allow configuring TTL of mapConfigs via "mapConfigTTL" 1.7.1 -- 2014-02-11 ------------------- diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 97d2315c..ea870444 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -26,6 +26,11 @@ var config = { ,maxConnections:128 // Maximum number of templates per user. Unlimited by default. ,maxUserTemplates:1024 + // Seconds since "last creation" before a detached + // or template instance map expires. Or: how long do you want + // to be able to navigate the map without a reload ? + // Defaults to 7200 (2 hours) + ,mapConfigTTL: 7200, // idle socket timeout, in miliseconds ,socket_timeout: 600000 ,enable_cors: true diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 255ae061..55ad0c02 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -26,6 +26,11 @@ var config = { ,maxConnections:128 // Maximum number of templates per user. Unlimited by default. ,maxUserTemplates:1024 + // Seconds since "last creation" before a detached + // or template instance map expires. Or: how long do you want + // to be able to navigate the map without a reload ? + // Defaults to 7200 (2 hours) + ,mapConfigTTL: 7200, // idle socket timeout, in miliseconds ,socket_timeout: 600000 ,enable_cors: true diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 1fb61fa9..5d54f500 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -26,6 +26,11 @@ var config = { ,maxConnections:128 // Maximum number of templates per user. Unlimited by default. ,maxUserTemplates:1024 + // Seconds since "last creation" before a detached + // or template instance map expires. Or: how long do you want + // to be able to navigate the map without a reload ? + // Defaults to 7200 (2 hours) + ,mapConfigTTL: 7200, // idle socket timeout, in miliseconds ,socket_timeout: 600000 ,enable_cors: true diff --git a/config/environments/test.js.example b/config/environments/test.js.example index b829e577..7bf14152 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -26,6 +26,11 @@ var config = { ,maxConnections:128 // Maximum number of templates per user. Unlimited by default. ,maxUserTemplates:1024 + // Seconds since "last creation" before a detached + // or template instance map expires. Or: how long do you want + // to be able to navigate the map without a reload ? + // Defaults to 7200 (2 hours) + ,mapConfigTTL: 7200, // idle socket timeout, in miliseconds ,socket_timeout: 600000 ,enable_cors: true diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 1504e061..35dffe07 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -47,8 +47,8 @@ module.exports = function(){ datasource: global.environment.postgres, cachedir: global.environment.millstone.cache_basedir, mapnik_version: global.environment.mapnik_version || mapnik.versions.mapnik, - default_layergroup_ttl: 7200, // seconds (default is 300) - gc_prob: 0.01 // default is 0.01 TODO: make configurable via env config + default_layergroup_ttl: global.environment.mapConfigTTL || 7200, + gc_prob: 0.01 // @deprecated since Windshaft-1.8.0 }, mapnik: { metatile: rendererConfig.metatile,