From ef171bf2af263fbf57cc4442c649e930ffff0240 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Sat, 4 Jul 2015 23:38:15 +0200 Subject: [PATCH] reverts map store changes --- lib/cartodb/server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index d7734fbf..1cdf451f 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -133,6 +133,7 @@ module.exports = function(serverOptions) { pool: redisPool, expire_time: serverOptions.grainstore.default_layergroup_ttl }); + app.mapStore = mapStore; var onTileErrorStrategy; if (global.environment.enabledFeatures.onTileErrorStrategy !== false) { @@ -678,6 +679,14 @@ module.exports = function(serverOptions) { function extractSQL(err) { assert.ifError(err); + // TODO: cached cache channel for token-based access should + // be constructed at renderer cache creation time + // See http://github.com/CartoDB/Windshaft-cartodb/issues/152 + if ( ! app.mapStore ) { + throw new Error('missing channel cache for token ' + req.params.token); + } + var mapStore = app.mapStore; + step( function loadFromStore() { mapStore.load(req.params.token, this);