reliable-get
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -91,3 +91,6 @@ 'use strict'; | ||
if (err) { return next(err, {stale: oldCacheData}); } | ||
if (err) { | ||
var staleContent = oldCacheData ? {stale: oldCacheData} : undefined; | ||
return next(err, staleContent); | ||
} | ||
@@ -113,4 +116,7 @@ // Honor fragment cache control headers in a simplistic way | ||
} else { | ||
new CircuitBreaker(options, config, eventHandler, pipeAndCacheContent, function(err, res) { | ||
if (err) { return next(err); } | ||
// Force no store | ||
res.headers['cache-control'] = 'no-store'; | ||
next(null, {content: res.content, headers: res.headers}); | ||
@@ -117,0 +123,0 @@ }); |
@@ -25,3 +25,3 @@ 'use strict'; | ||
var redisClient = redis.createClient(redisConfig.port, redisConfig.host, redisConfig.options); | ||
var redisClient = redis.createClient(redisConfig.port || null, redisConfig.host || null, redisConfig.options); | ||
@@ -28,0 +28,0 @@ // Prevent error events bubbling up to v8 and taking the worker down if redis is unavailable |
{ | ||
"name": "reliable-get", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A circuit breaker and cached wrapper for GET requests (enables reliable external service interaction).", | ||
@@ -30,2 +30,3 @@ "main": "index.js", | ||
"circuit-breaker-js": "0.0.1", | ||
"connect-route": "^0.1.4", | ||
"hogan.js": "^3.0.2", | ||
@@ -32,0 +33,0 @@ "html-entities": "^1.1.1", |
Sorry, the diff of this file is not supported yet
24222
19
570
13
+ Addedconnect-route@^0.1.4
+ Addedconnect-route@0.1.5(transitive)