Compare commits

..

12 Commits

Author SHA1 Message Date
Raul Ochoa
e75d17f0e1 Release 2.13.0 2015-09-21 22:45:50 +02:00
Raul Ochoa
77a5b70576 Update news and bump version 2015-09-21 22:43:33 +02:00
Raul Ochoa
59b0a00c6f Merge pull request #332 from CartoDB/static-namedmaps-x-cache
Keep x-cache-channel in named map static maps
2015-09-21 22:40:42 +02:00
Raul Ochoa
5d24da4f2b Keep x-cache-channel in named map static maps 2015-09-21 22:36:13 +02:00
Raul Ochoa
126491fc93 Remove unused xml file that was used in health check 2015-09-15 11:46:19 +02:00
Raul Ochoa
98d6170870 Adds notes about contributing 2015-09-08 16:44:44 +02:00
Raul Ochoa
7ae034d746 Remove no longer needed health check params 2015-09-07 18:40:20 +02:00
Raul Ochoa
c409c146bf Upgrade CDB_QueryTables to use latest version 2015-09-07 17:17:40 +02:00
Raul Ochoa
e0a7eb01cc Use torque renderer config
Adds some notes about db pool params in torque
2015-09-04 16:33:40 +02:00
Raul Ochoa
13a2001a2b Merge pull request #329 from CartoDB/health-check-no-results
Do not return results from health check
2015-08-28 18:50:00 +02:00
Raul Ochoa
d6102284a4 Do not return results from health check
It also removed old dependencies and takes disabled file path in ctor.
2015-08-28 17:41:40 +02:00
Raul Ochoa
bb17609ea3 Stubs next version 2015-08-27 17:48:06 +02:00
17 changed files with 81 additions and 32 deletions

11
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,11 @@
Contributing
---
The issue tracker is at [github.com/CartoDB/Windshaft-cartodb](https://github.com/CartoDB/Windshaft-cartodb).
We love pull requests from everyone, see [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing).
## Submitting Contributions
* You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://cartodb.com/contributing).

View File

@@ -1,4 +1,4 @@
Copyright (c) 2014, Vizzuality
Copyright (c) 2015, CartoDB
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -1,5 +1,13 @@
# Changelog
## 2.13.0
Released 2015-09-21
New features:
- Keep x-cache-channel in named map static maps
## 2.12.0
Released 2015-08-27

View File

@@ -95,3 +95,9 @@ Examples
--------
[CartoDB's Map Gallery](http://cartodb.com/gallery/) showcases several examples of visualisations built on top of this.
Contributing
---
See [CONTRIBUTING.md](CONTRIBUTING.md).

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -187,19 +187,18 @@ var CartodbWindshaft = function(serverOptions) {
* END Routing
******************************************************************************************************************/
var healthCheck = new HealthCheck(cartoData, Windshaft.tilelive);
var healthCheck = new HealthCheck(global.environment.disabled_file);
ws.get('/health', function(req, res) {
var healthConfig = global.environment.health || {};
if (!!healthConfig.enabled) {
var startTime = Date.now();
healthCheck.check(healthConfig, function(err, result) {
healthCheck.check(function(err) {
var ok = !err;
var response = {
enabled: true,
ok: ok,
elapsed: Date.now() - startTime,
result: result
elapsed: Date.now() - startTime
};
if (err) {
response.err = err.message;

View File

@@ -121,7 +121,6 @@ NamedStaticMapsController.prototype.named = function(req, res) {
// added by createLayergroup
cacheChannel = res.header('X-Cache-Channel');
res.removeHeader('X-Cache-Channel');
self.surrogateKeysCache.tag(res, new NamedMapsCacheEntry(cdbUser, template.name));
layergroupId = layergroup.layergroupid.split(":")[0];

View File

@@ -1,31 +1,20 @@
var fs = require('fs');
var step = require('step');
function HealthCheck(metadataBackend, tilelive) {
this.metadataBackend = metadataBackend;
this.tilelive = tilelive;
function HealthCheck(disableFile) {
this.disableFile = disableFile;
}
module.exports = HealthCheck;
HealthCheck.prototype.check = function(config, callback) {
HealthCheck.prototype.check = function(callback) {
var result = {
redis: {
ok: false
},
mapnik: {
ok: false
},
tile: {
ok: false
}
};
var self = this;
step(
function getManualDisable() {
fs.readFile(global.environment.disabled_file, this);
fs.readFile(self.disableFile, this);
},
function handleDisabledFile(err, data) {
var next = this;
@@ -39,7 +28,7 @@ HealthCheck.prototype.check = function(config, callback) {
}
},
function handleResult(err) {
callback(err, result);
return callback(err);
}
);
};

View File

@@ -1,4 +0,0 @@
<Map
background-color="#c33"
srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
</Map>

View File

@@ -79,6 +79,7 @@ module.exports = function(redisPool) {
},
renderer: {
mapnik: rendererConfig.mapnik,
torque: rendererConfig.torque,
http: rendererConfig.http
},
redis: global.environment.redis,

2
npm-shrinkwrap.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "windshaft-cartodb",
"version": "2.12.0",
"version": "2.13.0",
"dependencies": {
"cartodb-psql": {
"version": "0.4.0",

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "windshaft-cartodb",
"version": "2.12.0",
"version": "2.13.0",
"description": "A map tile server for CartoDB",
"keywords": [
"cartodb"

View File

@@ -59,7 +59,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();

View File

@@ -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;