Avoid to pass undefined layergroupTTL

This commit is contained in:
Daniel García Aubert 2019-11-13 19:29:41 +01:00
parent ccd01e6da5
commit 77e6fb8225

View File

@ -86,11 +86,15 @@ module.exports = class ApiRouter {
const windshaftLogger = environmentOptions.log_windshaft && global.log4js ? const windshaftLogger = environmentOptions.log_windshaft && global.log4js ?
global.log4js.getLogger('[windshaft]') : global.log4js.getLogger('[windshaft]') :
null; null;
const mapStore = new windshaft.storage.MapStore({
const mapStoreOptions = {
pool: redisPool, pool: redisPool,
expire_time: serverOptions.grainstore.default_layergroup_ttl,
logger: windshaftLogger 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 }); const rendererFactory = createRendererFactory({ redisPool, serverOptions, environmentOptions });