node-cache
node-cache copied to clipboard
calling put with TTL value within Promise chain fails
Something like:
return new Promise((resolve, reject) => {
...
cache.put(key, value, 90000);
resolve(value);
});
Will not work unless the optional TTL is removed.
👍
just hit this bug myself and confirming that it's a problem :-(
I believe memory-cache does not have this problem.
@rayjennings3rd I found https://www.npmjs.com/package/node-cache and confirmed it worked properly.
Sorry to have to switch away, but this is a major blocker and it doesn't look like it's being addressed.
@fluxsauce Yes, that is exactly what I switched to. Sorry, I got the names a bit mixed up. Memory-cache is this package (but it's git name is node-cache - Readme.md has it as memory-cache.) A bit confusing but the link you referenced: npm node-cache is exactly what I switch to a few weeks back and I can second confirmation that it works with a return new Promise() block. Glad you found it.