From 3c3731252dfffb2a197f6b18ad89a49c5859ab67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 7 May 2018 18:24:41 +0200 Subject: [PATCH] Respect default values with object.assign --- lib/cartodb/controllers/factory.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cartodb/controllers/factory.js b/lib/cartodb/controllers/factory.js index ce341fbd..27ad35bf 100644 --- a/lib/cartodb/controllers/factory.js +++ b/lib/cartodb/controllers/factory.js @@ -59,11 +59,11 @@ const ServerInfoController = require('./server-info'); module.exports = class ControllersFactory { constructor ({ serverOptions, environmentOptions }) { - const redisOptions = Object.assign({}, environmentOptions.redis, { + const redisOptions = Object.assign({ name: 'windshaft-server', unwatchOnRelease: false, noReadyCheck: true - }); + }, environmentOptions.redis); const redisPool = new RedisPool(redisOptions); @@ -84,10 +84,11 @@ module.exports = class ControllersFactory { const rendererFactory = createRendererFactory({ redisPool, serverOptions, environmentOptions }); - const rendererCacheOpts = Object.assign({}, serverOptions.renderCache || {}, { + const rendererCacheOpts = Object.assign({ ttl: 60000, // 60 seconds TTL by default statsInterval: 60000 // reports stats every milliseconds defined here - }); + }, serverOptions.renderCache || {}); + const rendererCache = new windshaft.cache.RendererCache(rendererFactory, rendererCacheOpts); const rendererStatsReporter = new RendererStatsReporter(rendererCache, rendererCacheOpts.statsInterval); rendererStatsReporter.start();