From 2eb7529efbe85471ae98c4d5e396c8a4f95a2f59 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 7 Apr 2015 12:52:33 +0200 Subject: [PATCH] Pick cacheOnTimeout and render limit from mapnik config - adds default mapnik configuration values - removes old top-level mapnik config, rely on renderer one --- lib/cartodb/server_options.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index a91e03e0..188ba578 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -33,9 +33,16 @@ module.exports = function(redisPool) { var rendererConfig = _.defaults(global.environment.renderer || {}, { cache_ttl: 60000, // milliseconds - metatile: 4, - bufferSize: 64, - statsInterval: 60000 + statsInterval: 60000, + mapnik: { + poolSize: 8, + metatile: 2, + bufferSize: 64, + snapToGrid: false, + clipByBox2d: false, + limits: {} + }, + http: {} }); var me = { @@ -63,11 +70,6 @@ module.exports = function(redisPool) { mapnik_tile_format: global.environment.mapnik_tile_format || 'png', default_layergroup_ttl: global.environment.mapConfigTTL || 7200 }, - mapnik: { - poolSize: rendererConfig.poolSize, - metatile: rendererConfig.metatile, - bufferSize: rendererConfig.bufferSize - }, statsd: global.environment.statsd, renderCache: { ttl: rendererConfig.cache_ttl, @@ -269,8 +271,8 @@ module.exports = function(redisPool) { function handleTilerLimits(err, renderLimit) { assert.ifError(err); rendererOptions.limits = { - cacheOnTimeout: global.environment.enabledFeatures.cacheOnTimeout || false, - render: renderLimit + cacheOnTimeout: rendererConfig.mapnik.limits.cacheOnTimeout || false, + render: renderLimit || rendererConfig.mapnik.limits.render || 0 }; return null; },