Use template string
This commit is contained in:
parent
d99e5a44f5
commit
b55c2ec55c
12
lib/cartodb/cache/named_map_provider_cache.js
vendored
12
lib/cartodb/cache/named_map_provider_cache.js
vendored
@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider');
|
||||
const templateName = require('../backends/template_maps').templateName;
|
||||
|
||||
const LruCache = require("lru-cache");
|
||||
|
||||
const NamedMapMapConfigProvider = require('../models/mapconfig/provider/named-map-provider');
|
||||
const { templateName } = require('../backends/template_maps');
|
||||
|
||||
const TEN_MINUTES_IN_MILLISECONDS = 1000 * 60 * 10;
|
||||
const ACTIONS = ['update', 'delete'];
|
||||
|
||||
@ -62,13 +62,13 @@ NamedMapProviderCache.prototype.invalidate = function(user, templateId) {
|
||||
this.providerCache.del(createNamedMapKey(user, templateId));
|
||||
};
|
||||
|
||||
function createNamedMapKey(user, templateId) {
|
||||
return user + ':' + templateName(templateId);
|
||||
function createNamedMapKey (user, templateId) {
|
||||
return `${user}:${templateName(templateId)}`;
|
||||
}
|
||||
|
||||
const providerKeyTpl = ctx => `${ctx.authToken}:${ctx.configHash}:${ctx.format}:${ctx.layer}:${ctx.scale_factor}`;
|
||||
|
||||
function createProviderKey(config, authToken, params) {
|
||||
function createProviderKey (config, authToken, params) {
|
||||
const defaults = {
|
||||
authToken: authToken || '',
|
||||
configHash: NamedMapMapConfigProvider.configHash(config),
|
||||
|
Loading…
Reference in New Issue
Block a user