async-deco
Advanced tools
Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "async-deco", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "A collection of decorators for adding features to asynchronous functions (callback or promise based).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -172,3 +172,6 @@ async-deco | ||
It logs "cache-hit" with {key: cache key, result: cache result} or "cache-error" (when the cache fails) with {cacheErr: error object from the cache}. | ||
It logs: | ||
* "cache-hit" with {key: cache key, result: cache result} | ||
* "cache-error" (when the cache fails) with {cacheErr: error object from the cache} | ||
* "cache-miss" (when the item is not in the cache) with {key: cache key} | ||
@@ -241,3 +244,6 @@ Proxy | ||
It logs "fallback-cache-hit" with {key: cache key, result: cache object, actualResult: {err: error returned, res: result returned}} or "fallback-cache-error" with {err: error returned by the function, cacheErr: error returned by the cache}. | ||
It logs: | ||
* "fallback-cache-hit" with {key: cache key, result: cache object, actualResult: {err: error returned, res: result returned}} | ||
* "fallback-cache-error" with {err: error returned by the function, cacheErr: error returned by the cache} | ||
* "fallback-cache-miss" with {key: cache key, actualResult: {err: error returned, res: result returned}} | ||
@@ -244,0 +250,0 @@ Timeout |
@@ -23,2 +23,3 @@ var defaultLogger = require('../utils/default-logger'); | ||
else { | ||
logger('cache-miss', {key: cacheQuery.key}); | ||
args[args.length - 1] = function (err, res) { | ||
@@ -25,0 +26,0 @@ if (!err) { |
@@ -32,3 +32,3 @@ var defaultLogger = require('../utils/default-logger'); | ||
else if (cacheQuery.cached === true && | ||
(!cacheQuery.stale || (useStale && cacheQuery.stale))) { | ||
(!cacheQuery.stale || (useStale && cacheQuery.stale))) { | ||
logger('fallback-cache-hit', {key: cacheQuery.key, result: cacheQuery, actualResult: {err: err, res: dep}}); | ||
@@ -38,2 +38,3 @@ cb(null, cacheQuery.hit); | ||
else { | ||
logger('fallback-cache-miss', {key: cacheQuery.key, actualResult: {err: err, res: dep}}); | ||
cb(err, dep); | ||
@@ -40,0 +41,0 @@ } |
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
97824
2642
511