reconnect if varnish is down
This commit is contained in:
parent
37cf676063
commit
74cd176eb5
@ -9,8 +9,9 @@ var CartodbWindshaft = function(serverOptions) {
|
||||
// set the cache chanel info to invalidate the cache on the frontend server
|
||||
serverOptions.afterTileRender = function(req, res, tile, headers, callback) {
|
||||
res.header('X-Cache-Channel', req.params.dbname);
|
||||
res.header('Last-Modified','Wed, 30 Aug 1978 00:00:00 GMT'); // special date in the past.
|
||||
res.header('Cache-Control','no-cache,must-revalidate, public');
|
||||
// note - not invalidating properly
|
||||
// res.header('Last-Modified','Wed, 30 Aug 1978 00:00:00 GMT'); // special date in the past.
|
||||
// res.header('Cache-Control','no-cache,must-revalidate, public');
|
||||
callback(null, tile, headers);
|
||||
};
|
||||
|
||||
|
@ -51,7 +51,15 @@ function VarnishClient(host, port, ready_callback) {
|
||||
// sends the command to the server
|
||||
function _send(cmd, callback) {
|
||||
cmd_callback = callback;
|
||||
client.write(cmd + '\n');
|
||||
|
||||
// If varnish down attempt simple reconnect
|
||||
try{
|
||||
client.write(cmd + '\n');
|
||||
} catch(err) {
|
||||
self.close();
|
||||
connect();
|
||||
client.write(cmd + '\n');
|
||||
}
|
||||
}
|
||||
|
||||
// run command if there is no peding response
|
||||
|
Loading…
Reference in New Issue
Block a user