diff --git a/lib/cartodb/cache/named_map_provider_cache.js b/lib/cartodb/cache/named_map_provider_cache.js index de879c73..c872b49d 100644 --- a/lib/cartodb/cache/named_map_provider_cache.js +++ b/lib/cartodb/cache/named_map_provider_cache.js @@ -1,9 +1,9 @@ 'use strict'; -var NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider'); -var templateName = require('../backends/template_maps').templateName; +const NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider'); +const templateName = require('../backends/template_maps').templateName; -var LruCache = require("lru-cache"); +const LruCache = require("lru-cache"); const TEN_MINUTES_IN_MILLISECONDS = 1000 * 60 * 10; const ACTIONS = ['update', 'delete']; @@ -31,9 +31,9 @@ function NamedMapProviderCache( module.exports = NamedMapProviderCache; NamedMapProviderCache.prototype.get = function(user, templateId, config, authToken, params, callback) { - var namedMapKey = createNamedMapKey(user, templateId); - var namedMapProviders = this.providerCache.get(namedMapKey) || {}; - var providerKey = createProviderKey(config, authToken, params); + const namedMapKey = createNamedMapKey(user, templateId); + const namedMapProviders = this.providerCache.get(namedMapKey) || {}; + const providerKey = createProviderKey(config, authToken, params); if (namedMapProviders.hasOwnProperty(providerKey)) { return callback(null, namedMapProviders[providerKey]); @@ -66,7 +66,7 @@ function createNamedMapKey(user, templateId) { return user + ':' + templateName(templateId); } -var providerKeyTpl = ctx => `${ctx.authToken}:${ctx.configHash}:${ctx.format}:${ctx.layer}:${ctx.scale_factor}`; +const providerKeyTpl = ctx => `${ctx.authToken}:${ctx.configHash}:${ctx.format}:${ctx.layer}:${ctx.scale_factor}`; function createProviderKey(config, authToken, params) { const defaults = {