Get the rendererCache's config right and avoid to set the NamedMapCacheReporter's interval to 'undefined'

This commit is contained in:
Daniel García Aubert 2020-04-04 18:51:22 +02:00
parent a8fb51ba25
commit 8bb4fbec12
3 changed files with 5 additions and 5 deletions

View File

@ -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();

View File

@ -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),

View File

@ -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;
}