async-deco
Advanced tools
Comparing version 7.0.1 to 7.0.2
{ | ||
"name": "async-deco", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"description": "A collection of decorators for adding features to asynchronous functions (callback or promise based).", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -25,2 +25,3 @@ var defaultLogger = require('../utils/default-logger'); | ||
args[args.length - 1] = function (err, res) { | ||
var key; | ||
if (condition(err, res)) { | ||
@@ -34,3 +35,3 @@ cache.query(args, function (e, cacheQuery) { | ||
(!cacheQuery.stale || (useStale && cacheQuery.stale))) { | ||
logger('fallback-cache-hit', {key: cacheQuery.key, result: cacheQuery, actualResult: {err: err, res: res}}); | ||
logger('fallback-cache-hit', {timing: cacheQuery.timing, key: cacheQuery.key, result: cacheQuery, actualResult: {err: err, res: res}}); | ||
cb(null, cacheQuery.hit); | ||
@@ -42,3 +43,3 @@ } | ||
else { | ||
logger('fallback-cache-miss', {key: cacheQuery.key, actualResult: {err: err, res: res}}); | ||
logger('fallback-cache-miss', {timing: cacheQuery.timing, key: cacheQuery.key, actualResult: {err: err, res: res}}); | ||
cb(err, res); | ||
@@ -50,4 +51,5 @@ } | ||
if (!noPush) { | ||
if (cache.push(args, res)) { | ||
logger('fallback-cache-set', {args: args, res: res}); | ||
key = cache.push(args, res); | ||
if (key) { | ||
logger('fallback-cache-set', {key: key, args: args, res: res}); | ||
} | ||
@@ -54,0 +56,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
135339
3652