Pick cacheOnTimeout and render limit from mapnik config
- adds default mapnik configuration values - removes old top-level mapnik config, rely on renderer one
This commit is contained in:
parent
1782f240ce
commit
2eb7529efb
@ -33,9 +33,16 @@ module.exports = function(redisPool) {
|
|||||||
|
|
||||||
var rendererConfig = _.defaults(global.environment.renderer || {}, {
|
var rendererConfig = _.defaults(global.environment.renderer || {}, {
|
||||||
cache_ttl: 60000, // milliseconds
|
cache_ttl: 60000, // milliseconds
|
||||||
metatile: 4,
|
statsInterval: 60000,
|
||||||
|
mapnik: {
|
||||||
|
poolSize: 8,
|
||||||
|
metatile: 2,
|
||||||
bufferSize: 64,
|
bufferSize: 64,
|
||||||
statsInterval: 60000
|
snapToGrid: false,
|
||||||
|
clipByBox2d: false,
|
||||||
|
limits: {}
|
||||||
|
},
|
||||||
|
http: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
var me = {
|
var me = {
|
||||||
@ -63,11 +70,6 @@ module.exports = function(redisPool) {
|
|||||||
mapnik_tile_format: global.environment.mapnik_tile_format || 'png',
|
mapnik_tile_format: global.environment.mapnik_tile_format || 'png',
|
||||||
default_layergroup_ttl: global.environment.mapConfigTTL || 7200
|
default_layergroup_ttl: global.environment.mapConfigTTL || 7200
|
||||||
},
|
},
|
||||||
mapnik: {
|
|
||||||
poolSize: rendererConfig.poolSize,
|
|
||||||
metatile: rendererConfig.metatile,
|
|
||||||
bufferSize: rendererConfig.bufferSize
|
|
||||||
},
|
|
||||||
statsd: global.environment.statsd,
|
statsd: global.environment.statsd,
|
||||||
renderCache: {
|
renderCache: {
|
||||||
ttl: rendererConfig.cache_ttl,
|
ttl: rendererConfig.cache_ttl,
|
||||||
@ -269,8 +271,8 @@ module.exports = function(redisPool) {
|
|||||||
function handleTilerLimits(err, renderLimit) {
|
function handleTilerLimits(err, renderLimit) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
rendererOptions.limits = {
|
rendererOptions.limits = {
|
||||||
cacheOnTimeout: global.environment.enabledFeatures.cacheOnTimeout || false,
|
cacheOnTimeout: rendererConfig.mapnik.limits.cacheOnTimeout || false,
|
||||||
render: renderLimit
|
render: renderLimit || rendererConfig.mapnik.limits.render || 0
|
||||||
};
|
};
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user