From c918b09e644a9dc9c2da974f058b2c7d33ce83df Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 10 Jul 2012 20:38:54 +0200 Subject: [PATCH] Require carto_data only after setting the global env (closes #28) This one is for "cluster.js", the previous was for app.js --- cluster.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cluster.js b/cluster.js index 9935d794..499e1568 100755 --- a/cluster.js +++ b/cluster.js @@ -19,7 +19,6 @@ if (ENV != 'development' && ENV != 'production'){ var _ = require('underscore') , Step = require('step') - , cartoData = require('./lib/cartodb/carto_data') , CartodbWindshaft = require('./lib/cartodb/cartodb_windshaft'); @@ -28,6 +27,10 @@ global.settings = require(__dirname + '/config/settings'); global.environment = require(__dirname + '/config/environments/' + ENV); _.extend(global.settings, global.environment); +// Include cart_data.js only _after_ the "global" variable is set +// See https://github.com/Vizzuality/Windshaft-cartodb/issues/28 +var cartoData = require('./lib/cartodb/carto_data'); + var Windshaft = require('windshaft'); var serverOptions = require('./lib/cartodb/server_options'); @@ -39,4 +42,4 @@ cluster(ws) .set('workers', 1) .listen(global.environment.port, global.environment.host); -console.log("Windshaft tileserver started on port " + global.environment.port); \ No newline at end of file +console.log("Windshaft tileserver started on port " + global.environment.port);