Browse Source

memoryStore.set() 增加 maxAge参数

feature/fix-isCacheableValue-usage
dan 10 years ago
parent
commit
bc824e6e02
  1. 7
      lib/stores/memory.js

7
lib/stores/memory.js

@ -18,8 +18,13 @@ var memoryStore = function(args) {
self.set = function(key, value, options, cb) {
if (typeof options === 'function') {
cb = options;
options = {};
}
lruCache.set(key, value);
options = options || {};
var maxAge = (options.ttl || options.ttl === 0) ? options.ttl : lruOpts.maxAge;
lruCache.set(key, value, maxAge);
if (cb) {
process.nextTick(cb);
}

Loading…
Cancel
Save