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

How to obtain TTL of the rest of the time #49

Closed
tangtang520 opened this issue Feb 24, 2016 · 5 comments
Closed

How to obtain TTL of the rest of the time #49

tangtang520 opened this issue Feb 24, 2016 · 5 comments

Comments

@tangtang520
Copy link

How to obtain TTL of the rest of the time

@mpneuried
Copy link
Contributor

There is currently no option to retrieve the ttl of a key.

@mpneuried
Copy link
Contributor

I added a method myCache.getTtl( key, [callback] ) to handle your need.
https://github.com/tcs-de/nodecache#get-ttl-getttl

@filly82
Copy link

filly82 commented Apr 21, 2016

when i try to get the TTL of an existing key my app just crash without any error. sync and async version.
when i try to get the TTL of an unknown key then i get an undefined like the doc says. what am i doing wrong?

@mpneuried
Copy link
Contributor

mpneuried commented Apr 21, 2016

@filly82 : can you provide me an example?
I tested the .getTtl() here: https://tonicdev.com/mpneuried/5718b7f13ffa30120097000f
Can you change the code, so i can reproduce your case.

@filly82
Copy link

filly82 commented Apr 21, 2016

of course i cannot reproduce it :(
this is basically what i am doing, but it works on that platform: https://tonicdev.com/5718bce2fab6891400f3d34c/5718c1e4a1e962110076c58e

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

No branches or pull requests

3 participants