Merge branch 'master' into private-cdb_tablemetadata
This commit is contained in:
commit
151968ae13
@ -209,26 +209,11 @@ var CartodbWindshaft = function(serverOptions) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper API to allow per table tile cache (and sql cache) to be invalidated remotely.
|
* Helper API to allow per table tile cache (and sql cache) to be invalidated remotely.
|
||||||
* TODO: Move?
|
* Keep endpoint for backwards compatibility
|
||||||
*/
|
*/
|
||||||
ws.del(serverOptions.base_url + '/flush_cache', function(req, res){
|
ws.del(serverOptions.base_url + '/flush_cache', function(req, res){
|
||||||
if ( req.profiler && req.profiler.statsd_client ) {
|
|
||||||
req.profiler.start('windshaft-cartodb.flush_cache');
|
|
||||||
}
|
|
||||||
ws.doCORS(res);
|
ws.doCORS(res);
|
||||||
Step(
|
ws.sendResponse(res, [{status: 'ok'}, 200]);
|
||||||
function flushCache(){
|
|
||||||
serverOptions.flushCache(req, serverOptions.cache_enabled ? Cache : null, this);
|
|
||||||
},
|
|
||||||
function sendResponse(err, data){
|
|
||||||
if (err){
|
|
||||||
ws.sendError(res, {error: err.message}, 500, 'DELETE CACHE', err);
|
|
||||||
//ws.sendResponse(res, [500]);
|
|
||||||
} else {
|
|
||||||
ws.sendResponse(res, [{status: 'ok'}, 200]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var healthCheck = new HealthCheck(cartoData, Windshaft.tilelive);
|
var healthCheck = new HealthCheck(cartoData, Windshaft.tilelive);
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
var _ = require('underscore')
|
var _ = require('underscore');
|
||||||
, Step = require('step')
|
var Step = require('step');
|
||||||
, Cache = require('./cache_validator')
|
var QueryTablesApi = require('./api/query_tables_api');
|
||||||
, QueryTablesApi = require('./api/query_tables_api')
|
var crypto = require('crypto');
|
||||||
, crypto = require('crypto')
|
var LZMA = require('lzma').LZMA;
|
||||||
, LZMA = require('lzma').LZMA
|
|
||||||
;
|
|
||||||
|
|
||||||
// This is for backward compatibility with 1.3.3
|
// This is for backward compatibility with 1.3.3
|
||||||
if ( _.isUndefined(global.environment.sqlapi.domain) ) {
|
if ( _.isUndefined(global.environment.sqlapi.domain) ) {
|
||||||
@ -824,33 +822,5 @@ module.exports = function(redisPool) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper to clear out tile cache on request
|
|
||||||
* @param req
|
|
||||||
* @param callback
|
|
||||||
*/
|
|
||||||
me.flushCache = function(req, Cache, callback){
|
|
||||||
var that = this;
|
|
||||||
|
|
||||||
Step(
|
|
||||||
function getParams(){
|
|
||||||
// this is mostly to compute req.params.dbname
|
|
||||||
that.req2params(req, this);
|
|
||||||
},
|
|
||||||
function flushInternalCache(err){
|
|
||||||
// TODO: implement this, see
|
|
||||||
// http://github.com/Vizzuality/Windshaft-cartodb/issues/73
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
function flushVarnishCache(err){
|
|
||||||
if (err) { callback(err); return; }
|
|
||||||
if(Cache) {
|
|
||||||
Cache.invalidate_db(req.params.dbname, req.params.table);
|
|
||||||
}
|
|
||||||
callback(null, true);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return me;
|
return me;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user