diff --git a/config/environments/development.js.example b/config/environments/development.js.example index 8a1cc7ad..d458976b 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -191,6 +191,20 @@ var config = { } } } + // anything analyses related + ,analysis: { + // batch configuration + batch: { + // Inline execution avoid the use of SQL API as batch endpoint + // When set to true it will run all analysis queries in series, with a direct connection to the DB + // This might be useful for: + // - testing + // - running an standalone server without any dependency on external services + inlineExecution: false, + // where the SQL API is running, it will use a custom Host header to specify the username. + endpoint: 'http://127.0.0.1:8080/api/v2/sql/job' + } + } ,millstone: { // Needs to be writable by server user cache_basedir: '/tmp/cdb-tiler-dev/millstone-dev' diff --git a/config/environments/production.js.example b/config/environments/production.js.example index 73c68f1d..bfed10ff 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -185,6 +185,20 @@ var config = { } } } + // anything analyses related + ,analysis: { + // batch configuration + batch: { + // Inline execution avoid the use of SQL API as batch endpoint + // When set to true it will run all analysis queries in series, with a direct connection to the DB + // This might be useful for: + // - testing + // - running an standalone server without any dependency on external services + inlineExecution: false, + // where the SQL API is running, it will use a custom Host header to specify the username. + endpoint: 'http://127.0.0.1:8080/api/v2/sql/job' + } + } ,millstone: { // Needs to be writable by server user cache_basedir: '/home/ubuntu/tile_assets/' diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index f81b88f7..6886d028 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -185,6 +185,20 @@ var config = { } } } + // anything analyses related + ,analysis: { + // batch configuration + batch: { + // Inline execution avoid the use of SQL API as batch endpoint + // When set to true it will run all analysis queries in series, with a direct connection to the DB + // This might be useful for: + // - testing + // - running an standalone server without any dependency on external services + inlineExecution: false, + // where the SQL API is running, it will use a custom Host header to specify the username. + endpoint: 'http://127.0.0.1:8080/api/v2/sql/job' + } + } ,millstone: { // Needs to be writable by server user cache_basedir: '/home/ubuntu/tile_assets/' diff --git a/config/environments/test.js.example b/config/environments/test.js.example index 0400be6e..758bfcb4 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -186,6 +186,20 @@ var config = { } } } + // anything analyses related + ,analysis: { + // batch configuration + batch: { + // Inline execution avoid the use of SQL API as batch endpoint + // When set to true it will run all analysis queries in series, with a direct connection to the DB + // This might be useful for: + // - testing + // - running an standalone server without any dependency on external services + inlineExecution: true, + // where the SQL API is running, it will use a custom Host header to specify the username. + endpoint: 'http://127.0.0.1:8080/api/v2/sql/job' + } + } ,millstone: { // Needs to be writable by server user cache_basedir: '/tmp/cdb-tiler-test/millstone' diff --git a/lib/cartodb/backends/dataview.js b/lib/cartodb/backends/dataview.js index f07ed6d1..510709c4 100644 --- a/lib/cartodb/backends/dataview.js +++ b/lib/cartodb/backends/dataview.js @@ -56,8 +56,6 @@ DataviewBackend.prototype.getDataview = function (mapConfigProvider, user, param pass: params.dbpassword }, batch: { - // TODO load this from configuration - endpoint: 'http://127.0.0.1:8080/api/v1/sql/job', username: user, apiKey: params.api_key } diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index ff6a0f1c..aed91641 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -150,8 +150,6 @@ MapController.prototype.create = function(req, res, prepareConfigFn) { pass: req.params.dbpassword }, batch: { - // TODO load this from configuration - endpoint: 'http://127.0.0.1:8080/api/v1/sql/job', username: req.context.user, apiKey: req.params.api_key } diff --git a/lib/cartodb/models/mapconfig/named_map_provider.js b/lib/cartodb/models/mapconfig/named_map_provider.js index b4646f7b..b1eaba8b 100644 --- a/lib/cartodb/models/mapconfig/named_map_provider.js +++ b/lib/cartodb/models/mapconfig/named_map_provider.js @@ -105,8 +105,6 @@ NamedMapMapConfigProvider.prototype.getMapConfig = function(callback) { pass: rendererParams.dbpassword }, batch: { - // TODO load this from configuration - endpoint: 'http://127.0.0.1:8080/api/v1/sql/job', username: self.owner, apiKey: apiKey } diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index f129807c..a75bba58 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -33,7 +33,8 @@ if (global.environment.statsd) { var analysisConfig = _.defaults(global.environment.analysis || {}, { batch: { - endpoint: 'http://127.0.0.1:8080/api/v1/sql/job' + inlineExecution: false, + endpoint: 'http://127.0.0.1:8080/api/v2/sql/job' } }); @@ -90,6 +91,7 @@ module.exports = { analysis: { batch: { + inlineExecution: analysisConfig.batch.inlineExecution, endpoint: analysisConfig.batch.endpoint } },