reliable-get
Advanced tools
Comparing version 0.1.24 to 0.1.25
10
index.js
@@ -41,3 +41,4 @@ 'use strict'; | ||
}); | ||
self.emit('stat', 'error', 'FAIL ' + message, {tracer:options.tracer, statusCode: statusCode, type:options.type}); | ||
self.emit('log', 'error', 'FAIL ' + message, {tracer:options.tracer, statusCode: statusCode, type:options.type}); | ||
self.emit('stat', 'increment', options.statsdKey + '.requestError'); | ||
cb({statusCode: statusCode || 500, message: message, headers: headers}); | ||
@@ -110,2 +111,9 @@ } | ||
var staleContent = oldCacheData ? _.extend(oldCacheData, {stale: true}) : undefined; | ||
if (oldCacheData) { | ||
self.emit('log', 'debug', 'Serving stale cache for key: ' + options.cacheKey, {tracer: options.tracer, type: options.type}); | ||
self.emit('stat', 'increment', options.statsdKey + '.cacheStale'); | ||
} else { | ||
self.emit('log', 'warn', 'Error and no stale cache available for key: ' + options.cacheKey, {tracer: options.tracer, type: options.type}); | ||
self.emit('stat', 'increment', options.statsdKey + '.cacheNoStale'); | ||
} | ||
return next(err, staleContent); | ||
@@ -112,0 +120,0 @@ } |
{ | ||
"name": "reliable-get", | ||
"version": "0.1.24", | ||
"version": "0.1.25", | ||
"description": "A circuit breaker and cached wrapper for GET requests (enables reliable external service interaction).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33627554
1056