diff --git a/lib/api/api-router.js b/lib/api/api-router.js index 142c3eba..ea38b88c 100644 --- a/lib/api/api-router.js +++ b/lib/api/api-router.js @@ -86,11 +86,15 @@ module.exports = class ApiRouter { const windshaftLogger = environmentOptions.log_windshaft && global.log4js ? global.log4js.getLogger('[windshaft]') : null; - const mapStore = new windshaft.storage.MapStore({ + + const mapStoreOptions = { pool: redisPool, - expire_time: serverOptions.grainstore.default_layergroup_ttl, logger: windshaftLogger - }); + }; + if (Number.isFinite(serverOptions.grainstore.default_layergroup_ttl)) { + mapStoreOptions.expire_time = serverOptions.grainstore.default_layergroup_ttl; + } + const mapStore = new windshaft.storage.MapStore(mapStoreOptions); const rendererFactory = createRendererFactory({ redisPool, serverOptions, environmentOptions });