memorystore
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -28,2 +28,8 @@ /*! | ||
function prune (store) { | ||
store.forEach(function (value, key) { | ||
store.get(key) | ||
}) | ||
} | ||
var defer = typeof setImmediate === 'function' | ||
@@ -65,6 +71,8 @@ ? setImmediate | ||
this.options = options || {} | ||
this.options = {} | ||
this.options.checkPeriod = options.checkPeriod || oneDay | ||
this.options.max = options.max || Infinity | ||
this.options.ttl = options.ttl | ||
this.options.dispose = options.dispose | ||
this.options.stale = options.stale | ||
@@ -76,3 +84,3 @@ this.store = LRU(this.options) | ||
debug('Pruning old entries') | ||
self.store.prune() // iterates over the entire cache proactively pruning old entries | ||
prune(self.store) // iterates over the entire cache proactively pruning old entries | ||
}, this.options.checkPeriod) | ||
@@ -79,0 +87,0 @@ } |
{ | ||
"name": "memorystore", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "express-session full featured MemoryStore layer without leaks!", | ||
@@ -30,7 +30,7 @@ "main": "index.js", | ||
"debug": "2.6.8", | ||
"lru-cache": "~4.1.1" | ||
"lru-cache": "~2.7.3" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^3.4.2", | ||
"standard": "^10.0.2" | ||
"mocha": "3.4.2", | ||
"standard": "10.0.2" | ||
}, | ||
@@ -37,0 +37,0 @@ "standard": { |
@@ -46,6 +46,2 @@ # memorystore [](https://www.npmjs.com/package/memorystore) [](https://travis-ci.org/roccomuso/memorystore) [](https://david-dm.org/roccomuso/memorystore) [](https://standardjs.com) | ||
get a stale entry, as if it had already been deleted. | ||
* `noDisposeOnSet` By default, if you set a `dispose()` method, then | ||
it'll be called whenever a `set()` operation overwrites an existing | ||
key. If you set this option, `dispose()` will only be called when a | ||
key falls out of the cache, not when it is overwritten. | ||
@@ -52,0 +48,0 @@ ## Debug |
@@ -25,4 +25,3 @@ var assert = require('assert') | ||
dispose: null, | ||
stale: true, | ||
noDisposeOnSet: true | ||
stale: true | ||
}) | ||
@@ -34,3 +33,2 @@ assert.equal(store.options.max, 10, 'should set the max option') | ||
assert.equal(store.options.stale, true, 'should set stale') | ||
assert.equal(store.options.noDisposeOnSet, true, 'should set noDisposeOnSet') | ||
done() | ||
@@ -37,0 +35,0 @@ }) |
405
17974
58
+ Addedlru-cache@2.7.3(transitive)
- Removedlru-cache@4.1.5(transitive)
- Removedpseudomap@1.0.2(transitive)
- Removedyallist@2.1.2(transitive)
Updatedlru-cache@~2.7.3