Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calling put with TTL value within Promise chain fails #91

Open
rayjennings3rd opened this issue Aug 22, 2017 · 5 comments
Open

calling put with TTL value within Promise chain fails #91

rayjennings3rd opened this issue Aug 22, 2017 · 5 comments

Comments

@rayjennings3rd
Copy link

rayjennings3rd commented Aug 22, 2017

Something like:

return new Promise((resolve, reject) => {
...
  cache.put(key, value, 90000);
  resolve(value);

});

Will not work unless the optional TTL is removed.

@mfrye
Copy link

mfrye commented Sep 15, 2017

👍

@fluxsauce
Copy link

just hit this bug myself and confirming that it's a problem :-(

@rayjennings3rd
Copy link
Author

I believe memory-cache does not have this problem.

@fluxsauce
Copy link

fluxsauce commented Oct 30, 2017

@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.

@rayjennings3rd
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants