diff --git a/lib/cartodb/api/query_tables_api.js b/lib/cartodb/api/query_tables_api.js index f4795b05..57a3172e 100644 --- a/lib/cartodb/api/query_tables_api.js +++ b/lib/cartodb/api/query_tables_api.js @@ -138,7 +138,7 @@ function prepareSql(sql) { function shouldQueryPostgresDirectly() { - return global.environment - && global.environment.enabledFeatures - && global.environment.enabledFeatures.cdbQueryTablesFromPostgres; + return global.environment && + global.environment.enabledFeatures && + global.environment.enabledFeatures.cdbQueryTablesFromPostgres; } diff --git a/lib/cartodb/cartodb_windshaft.js b/lib/cartodb/cartodb_windshaft.js index 477a4c24..7d1d2d9a 100644 --- a/lib/cartodb/cartodb_windshaft.js +++ b/lib/cartodb/cartodb_windshaft.js @@ -18,8 +18,8 @@ var CartodbWindshaft = function(serverOptions) { } } - var redisPool = serverOptions.redis.pool - || require('redis-mpool')(_.extend(global.environment.redis, {name: 'windshaft:cartodb'})); + var redisPool = serverOptions.redis.pool || + require('redis-mpool')(_.extend(global.environment.redis, {name: 'windshaft:cartodb'})); var cartoData = require('cartodb-redis')({pool: redisPool}); diff --git a/lib/cartodb/controllers/template_maps.js b/lib/cartodb/controllers/template_maps.js index 5b61ae56..f683412d 100644 --- a/lib/cartodb/controllers/template_maps.js +++ b/lib/cartodb/controllers/template_maps.js @@ -100,8 +100,7 @@ TemplateMapsController.prototype.update = function(req, res) { tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] != cdbuser ) { - err = new Error("Invalid template id '" - + req.params.template_id + "' for user '" + cdbuser + "'"); + err = new Error("Invalid template id '" + req.params.template_id + "' for user '" + cdbuser + "'"); err.http_status = 404; throw err; } @@ -158,8 +157,8 @@ TemplateMapsController.prototype.retrieve = function(req, res) { tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] != cdbuser ) { - var err = new Error("Cannot get template id '" - + req.params.template_id + "' for user '" + cdbuser + "'"); + var err = new Error("Cannot get template id '" + req.params.template_id + "' for user '" + cdbuser + + "'"); err.http_status = 404; throw err; } @@ -220,8 +219,8 @@ TemplateMapsController.prototype.destroy = function(req, res) { tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] != cdbuser ) { - var err = new Error("Cannot find template id '" - + req.params.template_id + "' for user '" + cdbuser + "'"); + var err = new Error("Cannot find template id '" + req.params.template_id + "' for user '" + + cdbuser + "'"); err.http_status = 404; throw err; } @@ -361,9 +360,8 @@ TemplateMapsController.prototype.instantiateTemplate = function(req, res, templa var tpl_id = req.params.template_id.split('@'); if ( tpl_id.length > 1 ) { if ( tpl_id[0] && tpl_id[0] != cdbuser ) { - var err = new Error('Cannot instanciate map of user "' - + tpl_id[0] + '" on database of user "' - + cdbuser + '"'); + var err = new Error('Cannot instanciate map of user "' + tpl_id[0] + '" on database of user "' + cdbuser + + '"'); err.http_status = 403; callback(err); return; diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index e0011795..da71e5c8 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -35,8 +35,8 @@ var REQUEST_QUERY_PARAMS_WHITELIST = [ ]; module.exports = function(redisPool) { - redisPool = redisPool - || require('redis-mpool')(_.extend(global.environment.redis, {name: 'windshaft:server_options'})); + redisPool = redisPool || + require('redis-mpool')(_.extend(global.environment.redis, {name: 'windshaft:server_options'})); var cartoData = require('cartodb-redis')({ pool: redisPool }), lzmaWorker = new LZMA(), @@ -377,14 +377,13 @@ module.exports = function(redisPool) { var host = req.headers.host; var mat = host.match(this.re_userFromHost); if ( ! mat ) { - console.error("ERROR: user pattern '" + this.re_userFromHost - + "' does not match hostname '" + host + "'"); + console.error("ERROR: user pattern '" + this.re_userFromHost + "' does not match hostname '" + host + "'"); return; } // console.log("Matches: "); console.dir(mat); if ( ! mat.length === 2 ) { - console.error("ERROR: pattern '" + this.re_userFromHost - + "' gave unexpected matches against '" + host + "': " + mat); + console.error("ERROR: pattern '" + this.re_userFromHost + "' gave unexpected matches against '" + host + "': " + + mat); return; } return mat[1]; diff --git a/lib/cartodb/sql/sql_api.js b/lib/cartodb/sql/sql_api.js index 44c831e2..d5f742f9 100644 --- a/lib/cartodb/sql/sql_api.js +++ b/lib/cartodb/sql/sql_api.js @@ -36,11 +36,11 @@ module.exports.query = function (username, api_key, sql, callback) { var reqSpec = { url:sqlapi, json:true, - headers:{host: sqlapihostname} + headers:{host: sqlapihostname}, // http://nodejs.org/api/http.html#http_agent_maxsockets - ,pool:{maxSockets:maxSockets} + pool:{maxSockets:maxSockets}, // timeout in milliseconds - ,timeout:maxSQLTime + timeout:maxSQLTime }; if ( sql.length > maxGetLen ) { reqSpec.method = 'POST'; diff --git a/lib/cartodb/template_maps.js b/lib/cartodb/template_maps.js index 164161a8..ab46ecc9 100644 --- a/lib/cartodb/template_maps.js +++ b/lib/cartodb/template_maps.js @@ -450,16 +450,14 @@ o.instance = function(template, params) { else if ( type === 'number' ) { // check it's a number if ( typeof(val) !== 'number' && ! val.match(_reNumber) ) { - throw new Error("Invalid number value for template parameter '" - + k + "': " + val); + throw new Error("Invalid number value for template parameter '" + k + "': " + val); } } else if ( type === 'css_color' ) { // check it only contains letters or // starts with # and only contains hexdigits if ( ! val.match(_reCSSColorName) && ! val.match(_reCSSColorVal) ) { - throw new Error("Invalid css_color value for template parameter '" - + k + "': " + val); + throw new Error("Invalid css_color value for template parameter '" + k + "': " + val); } } else {