cache-manager
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -0,1 +1,4 @@ | ||
- 2.6.0 2017-12-08 | ||
- fix multicaching when result is not cacheable (#106) - @gswalden | ||
- 2.5.0 2017-10-09 | ||
@@ -2,0 +5,0 @@ - Add explicit return in wrapPromise (#109) - @jeff-kilbride |
@@ -242,3 +242,3 @@ /** @module cacheManager/multiCaching */ | ||
if (!self._isCacheableValue(data)) { | ||
return cb(); | ||
return callbackFiller.fill(key, err, data); | ||
} | ||
@@ -245,0 +245,0 @@ |
{ | ||
"name": "cache-manager", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Cache module for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -709,2 +709,54 @@ var assert = require('assert'); | ||
}); | ||
it("allows repeated calls for uncacheable value", function(done) { | ||
function getUndefined(name, cb) { | ||
multiCache.wrap(key, function(cacheCb) { | ||
process.nextTick(function() { | ||
cacheCb(null, undefined); | ||
}); | ||
}, cb); | ||
} | ||
var name = 'oof'; | ||
getUndefined(name, function(err, val) { | ||
checkErr(err); | ||
assert.ok(val === undefined); | ||
getUndefined(name, function(err, val) { | ||
checkErr(err); | ||
assert.ok(val === undefined); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
it("allows simultaneous calls for uncacheable value", function(done) { | ||
var results = [true, undefined]; | ||
function getUndefined(name, cb) { | ||
multiCache.wrap(key, function(cacheCb) { | ||
process.nextTick(function() { | ||
cacheCb(null, results.pop()); | ||
}); | ||
}, cb); | ||
} | ||
var name = 'oof'; | ||
getUndefined(name, function(err, val) { | ||
checkErr(err); | ||
assert.ok(val === undefined); | ||
}); | ||
getUndefined(name, function(err, val) { | ||
checkErr(err); | ||
assert.ok(val === undefined); | ||
// ensure we didn't cache "undefined" | ||
getUndefined(name, function(err, val) { | ||
checkErr(err); | ||
assert.ok(val === true); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -711,0 +763,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
143237
3042