diff --git a/config/environments/development.js.example b/config/environments/development.js.example index c3401aa2..bf98ca23 100644 --- a/config/environments/development.js.example +++ b/config/environments/development.js.example @@ -162,6 +162,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/production.js.example b/config/environments/production.js.example index d251ac8e..386f4433 100644 --- a/config/environments/production.js.example +++ b/config/environments/production.js.example @@ -156,6 +156,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/staging.js.example b/config/environments/staging.js.example index 5fe72c9e..f692d2ba 100644 --- a/config/environments/staging.js.example +++ b/config/environments/staging.js.example @@ -156,6 +156,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/config/environments/test.js.example b/config/environments/test.js.example index f0002aa5..13132e9a 100644 --- a/config/environments/test.js.example +++ b/config/environments/test.js.example @@ -158,6 +158,16 @@ var config = { type: 'fs', // 'fs' and 'url' supported src: __dirname + '/../../assets/default-placeholder.png' } + }, + torque: { + dbPoolParams: { + // maximum number of resources to create at any given time + size: 16, + // max milliseconds a resource can go unused before it should be destroyed + idleTimeout: 3000, + // frequency to check for idle resources + reapInterval: 1000 + } } } ,millstone: { diff --git a/lib/cartodb/controllers/server_info.js b/lib/cartodb/controllers/server_info.js index d8e038c1..a6bc040e 100644 --- a/lib/cartodb/controllers/server_info.js +++ b/lib/cartodb/controllers/server_info.js @@ -37,7 +37,7 @@ ServerInfoController.prototype.version = function(req, res) { ServerInfoController.prototype.health = function(req, res) { if (!!this.healthConfig.enabled) { var startTime = Date.now(); - this.healthCheck.check(this.healthConfig, function(err) { + this.healthCheck.check(function(err) { var ok = !err; var response = { enabled: true, diff --git a/lib/cartodb/monitoring/health_check.js b/lib/cartodb/monitoring/health_check.js index dd405149..69425c2e 100644 --- a/lib/cartodb/monitoring/health_check.js +++ b/lib/cartodb/monitoring/health_check.js @@ -8,7 +8,7 @@ function HealthCheck(disableFile) { module.exports = HealthCheck; -HealthCheck.prototype.check = function(config, callback) { +HealthCheck.prototype.check = function(callback) { var self = this; diff --git a/lib/cartodb/server_options.js b/lib/cartodb/server_options.js index c0c60270..c8af69d8 100644 --- a/lib/cartodb/server_options.js +++ b/lib/cartodb/server_options.js @@ -62,6 +62,7 @@ module.exports = { }, renderer: { mapnik: rendererConfig.mapnik, + torque: rendererConfig.torque, http: rendererConfig.http }, // Do not send unwatch on release. See http://github.com/CartoDB/Windshaft-cartodb/issues/161 diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4cc75faf..dc3d8f5c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -191,14 +191,14 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" }, "mime-types": { - "version": "2.1.5", + "version": "2.1.6", "from": "mime-types@~2.1.2", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.5.tgz", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.6.tgz", "dependencies": { "mime-db": { - "version": "1.17.0", - "from": "mime-db@~1.17.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.17.0.tgz" + "version": "1.18.0", + "from": "mime-db@~1.18.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.18.0.tgz" } } }, @@ -372,9 +372,9 @@ } }, "is-my-json-valid": { - "version": "2.12.1", + "version": "2.12.2", "from": "is-my-json-valid@^2.12.0", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.1.tgz", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.2.tgz", "dependencies": { "generate-function": { "version": "2.0.0", @@ -394,9 +394,9 @@ } }, "jsonpointer": { - "version": "1.1.0", - "from": "jsonpointer@^1.1.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-1.1.0.tgz" + "version": "2.0.0", + "from": "jsonpointer@2.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, "xtend": { "version": "4.0.0", @@ -524,7 +524,7 @@ "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" }, "windshaft": { - "version": "0.51.1", + "version": "0.52.0", "from": "https://github.com/CartoDB/Windshaft/tarball/backend-foundations", "resolved": "https://github.com/CartoDB/Windshaft/tarball/backend-foundations", "dependencies": { @@ -2287,6 +2287,18 @@ } } }, + "debug": { + "version": "2.2.0", + "from": "debug@~2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "dependencies": { + "ms": { + "version": "0.7.1", + "from": "ms@0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + } + } + }, "tilelive": { "version": "4.5.3", "from": "tilelive@~4.5.3", diff --git a/test/acceptance/health_check.js b/test/acceptance/health_check.js index ba6340a7..68ca3346 100644 --- a/test/acceptance/health_check.js +++ b/test/acceptance/health_check.js @@ -60,7 +60,7 @@ describe('health checks', function () { callback(null, "Maintenance"); }; - healthCheck.check(null, function(err/*, result*/) { + healthCheck.check(function(err) { assert.equal(err.message, "Maintenance"); assert.equal(err.http_status, 503); done(); diff --git a/test/support/sql/CDB_QueryTables.sql b/test/support/sql/CDB_QueryTables.sql index ac61281d..c7cfa64b 100644 --- a/test/support/sql/CDB_QueryTables.sql +++ b/test/support/sql/CDB_QueryTables.sql @@ -41,11 +41,11 @@ BEGIN xpath('//x:Relation-Name/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as x, xpath('//x:Relation-Name/../x:Schema/text()', exp, ARRAY[ARRAY['x', 'http://www.postgresql.org/2009/explain']]) as s ) - SELECT unnest(x) as p, unnest(s) as sc from inp + SELECT unnest(x)::text as p, unnest(s)::text as sc from inp LOOP -- RAISE DEBUG 'tab: %', rec2.p; -- RAISE DEBUG 'sc: %', rec2.sc; - tables := array_append(tables, (rec2.sc || '.' || rec2.p)); + tables := array_append(tables, format('%s.%s', quote_ident(rec2.sc), quote_ident(rec2.p))); END LOOP; -- RAISE DEBUG 'Tables: %', tables;