jshint: fix Function declarations should not be placed in blocks
This commit is contained in:
parent
bd1c24ee1c
commit
438ecd5598
@ -8,7 +8,7 @@
|
|||||||
// "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
|
// "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
|
||||||
// "camelcase" : false, // true: Identifiers must be in camelCase
|
// "camelcase" : false, // true: Identifiers must be in camelCase
|
||||||
// "curly" : true, // true: Require {} for every new block or scope
|
// "curly" : true, // true: Require {} for every new block or scope
|
||||||
"eqeqeq" : true, // true: Require triple equals (===) for comparison
|
// "eqeqeq" : true, // true: Require triple equals (===) for comparison
|
||||||
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
|
"forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
|
||||||
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
|
"freeze" : true, // true: prohibits overwriting prototypes of native objects such as Array, Date etc.
|
||||||
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
|
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
|
||||||
|
@ -54,15 +54,15 @@ var CartodbWindshaft = function(serverOptions) {
|
|||||||
varnishHttpCacheBackend = new VarnishHttpCacheBackend(serverOptions.varnish_host, serverOptions.varnish_http_port),
|
varnishHttpCacheBackend = new VarnishHttpCacheBackend(serverOptions.varnish_host, serverOptions.varnish_http_port),
|
||||||
surrogateKeysCache = new SurrogateKeysCache(varnishHttpCacheBackend);
|
surrogateKeysCache = new SurrogateKeysCache(varnishHttpCacheBackend);
|
||||||
|
|
||||||
if (serverOptions.varnish_purge_enabled) {
|
function invalidateNamedMap (owner, templateName) {
|
||||||
function invalidateNamedMap(owner, templateName) {
|
surrogateKeysCache.invalidate(new NamedMapsCacheEntry(owner, templateName), function(err) {
|
||||||
surrogateKeysCache.invalidate(new NamedMapsCacheEntry(owner, templateName), function(err) {
|
if (err) {
|
||||||
if (err) {
|
console.warn('Cache: surrogate key invalidation failed');
|
||||||
console.warn('Cache: surrogate key invalidation failed');
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
if (serverOptions.varnish_purge_enabled) {
|
||||||
['update', 'delete'].forEach(function(eventType) {
|
['update', 'delete'].forEach(function(eventType) {
|
||||||
templateMaps.on(eventType, invalidateNamedMap);
|
templateMaps.on(eventType, invalidateNamedMap);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user