diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index 62c6248a..db28124c 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -559,21 +559,20 @@ module.exports = function(){ dbport: global.environment.postgres.port }); Step( - function getDatabaseHost(){ - cartoData.getUserDBHost(dbowner, this); + function getConnectionParams() { + cartoData.getUserDBConnectionParams(dbowner, this); }, - function getDatabase(err, data){ - if(err) throw err; - if ( data ) _.extend(params, {dbhost:data}); - cartoData.getUserDBName(dbowner, this); - }, - function extendParams(err, data){ + function extendParams(err, dbParams){ if (err) throw err; - if ( data ) _.extend(params, {dbname:data}); + // we don't want null values or overwrite a non public user + if (params.dbuser != 'publicuser' || !dbParams.dbuser) { + delete dbParams.dbuser; + } + if ( dbParams ) _.extend(params, dbParams); return null; }, function finish(err) { - callback(err); + callback(err); } ); }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9c0c1ef3..c03e5fc8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -934,7 +934,8 @@ "version": "2.9.202" }, "cartodb-redis": { - "version": "0.3.0" + "version": "0.5.0", + "from": "git://github.com/CartoDB/node-cartodb-redis.git#0.5.0" }, "redis-mpool": { "version": "0.0.4", diff --git a/package.json b/package.json index 231cc3cb..b22828df 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "windshaft" : "http://github.com/CartoDB/Windshaft/tarball/0.21.0", "step": "0.0.x", "request": "2.9.202", - "cartodb-redis": "~0.3.0", + "cartodb-redis": "git://github.com/CartoDB/node-cartodb-redis.git#0.5.0", "redis-mpool": "http://github.com/CartoDB/node-redis-mpool/tarball/0.0.4", "mapnik": "http://github.com/Vizzuality/node-mapnik/tarball/0.7.26-cdb1", "lzma": "~1.2.3",