Do not inject NamedMapsCacheEntry as template controller knows about them

Also do not inject pgConnection
This commit is contained in:
Raul Ochoa
2015-04-27 14:52:36 +02:00
parent e7bd5dd644
commit ef8fcf7e93
2 changed files with 5 additions and 8 deletions
+1 -3
View File
@@ -146,9 +146,7 @@ var CartodbWindshaft = function(serverOptions) {
templateMaps,
cartoData,
template_baseurl,
surrogateKeysCache,
NamedMapsCacheEntry,
serverOptions.pgConnection
surrogateKeysCache
);
templateMapsController.register(ws);
+4 -5
View File
@@ -3,17 +3,16 @@ var assert = require('assert');
var _ = require('underscore');
var templateName = require('../template_maps').templateName;
var CdbRequest = require('../models/cdb_request');
var NamedMapsCacheEntry = require('../cache/model/named_maps_entry');
function TemplateMapsController(app, serverOptions, templateMaps, metadataBackend, templateBaseUrl, surrogateKeysCache,
NamedMapsCacheEntry, pgConnection) {
function TemplateMapsController(app, serverOptions, templateMaps, metadataBackend, templateBaseUrl, surrogateKeysCache)
{
this.app = app;
this.serverOptions = serverOptions;
this.templateMaps = templateMaps;
this.metadataBackend = metadataBackend;
this.templateBaseUrl = templateBaseUrl;
this.surrogateKeysCache = surrogateKeysCache;
this.NamedMapsCacheEntry = NamedMapsCacheEntry;
this.pgConnection = pgConnection;
}
module.exports = TemplateMapsController;
@@ -322,7 +321,7 @@ TemplateMapsController.prototype.instantiateTemplate = function(req, res, templa
var tplhash = self.templateMaps.fingerPrint(template).substring(0,8);
layergroup.layergroupid = cdbuser + '@' + tplhash + '@' + layergroup.layergroupid;
self.surrogateKeysCache.tag(res, new self.NamedMapsCacheEntry(cdbuser, template.name));
self.surrogateKeysCache.tag(res, new NamedMapsCacheEntry(cdbuser, template.name));
return layergroup;
},