Create redis pool in server options when not supplied

This commit is contained in:
Raul Ochoa 2015-01-30 15:28:55 +01:00
parent 5573dfda84
commit aecb07b008

View File

@ -34,8 +34,10 @@ var REQUEST_QUERY_PARAMS_WHITELIST = [
];
module.exports = function(redisPool) {
var redisOpts = redisPool ? {pool: redisPool} : global.environment.redis;
var cartoData = require('cartodb-redis')(redisOpts),
redisPool = redisPool
|| require('redis-mpool')(_.extend(global.environment.redis, {name: 'windshaft:server_options'}));
var cartoData = require('cartodb-redis')({ pool: redisPool }),
lzmaWorker = new LZMA(),
queryTablesApi = new QueryTablesApi();