Get the rendererCache's config right and avoid to set the NamedMapCacheReporter's interval to 'undefined'
This commit is contained in:
parent
a8fb51ba25
commit
8bb4fbec12
@ -94,7 +94,7 @@ module.exports = class ApiRouter {
|
||||
logger: windshaftLogger
|
||||
});
|
||||
|
||||
const rendererStatsReporter = new RendererStatsReporter(rendererCache, serverOptions.statsInterval);
|
||||
const rendererStatsReporter = new RendererStatsReporter(rendererCache, serverOptions.renderCache.statsInterval);
|
||||
rendererStatsReporter.start();
|
||||
|
||||
const metadataBackend = cartodbRedis({ pool: redisPool });
|
||||
@ -157,7 +157,7 @@ module.exports = class ApiRouter {
|
||||
|
||||
const namedMapProviderCacheReporter = new NamedMapProviderCacheReporter({
|
||||
namedMapProviderCache,
|
||||
intervalInMilliseconds: serverOptions.statsInterval
|
||||
intervalInMilliseconds: serverOptions.renderCache.statsInterval
|
||||
});
|
||||
namedMapProviderCacheReporter.start();
|
||||
|
||||
|
@ -102,8 +102,8 @@ module.exports = {
|
||||
},
|
||||
statsd: global.environment.statsd,
|
||||
renderCache: {
|
||||
ttl: rendererConfig.cache_ttl,
|
||||
statsInterval: rendererConfig.statsInterval
|
||||
ttl: rendererConfig.cache_ttl || 60000,
|
||||
statsInterval: rendererConfig.statsInterval || 60000
|
||||
},
|
||||
renderer: {
|
||||
mvt: Object.assign({ dbPoolParams: global.environment.postgres.pool }, rendererConfig.mvt),
|
||||
|
@ -5,7 +5,7 @@ const statKeyTemplate = ctx => `windshaft.named-map-provider-cache.${ctx.metric}
|
||||
module.exports = class NamedMapProviderCacheReporter {
|
||||
constructor ({ namedMapProviderCache, intervalInMilliseconds } = {}) {
|
||||
this.namedMapProviderCache = namedMapProviderCache;
|
||||
this.intervalInMilliseconds = intervalInMilliseconds;
|
||||
this.intervalInMilliseconds = intervalInMilliseconds || 60000;
|
||||
this.intervalId = null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user