Subscribes to named map changes to invalidate cache

This commit is contained in:
Raul Ochoa
2015-07-14 21:18:10 +02:00
parent 1f7daab677
commit bbec3ae7da
+3
View File
@@ -167,6 +167,9 @@ module.exports = function(serverOptions) {
app.layergroupAffectedTablesCache = layergroupAffectedTablesCache;
var namedMapProviderCache = new NamedMapProviderCache(templateMaps, pgConnection, userLimitsApi, queryTablesApi);
['update', 'delete'].forEach(function(eventType) {
templateMaps.on(eventType, namedMapProviderCache.invalidate.bind(namedMapProviderCache));
});
var authApi = new AuthApi(pgConnection, metadataBackend, mapStore, templateMaps);