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

Fetching current expiry value #132

Open
alexanderkraemer opened this issue Mar 6, 2018 · 2 comments
Open

Fetching current expiry value #132

alexanderkraemer opened this issue Mar 6, 2018 · 2 comments
Labels

Comments

@alexanderkraemer
Copy link

Is it somehow possible to fetch the current expiry time in seconds from the key/value stores such as Redis?
Redis provides a method called TTL to get such information.

@asppsa
Copy link
Collaborator

asppsa commented Mar 10, 2018

Hi,

I think at present the only way to do this at present is to access the backend directly and do the ttl query on the underlying Redis object. You can do this with store.backend or store.adapter.backend (the latter most likely). Unfortunately this means that you will have to do any key transformation manually, so it's not a great solution.

We could also look at adding an expiry query to the Moneta interface. This would depend on our being able to implement the feature on other backends.

@asppsa asppsa added the Feature label May 6, 2018
@asppsa asppsa changed the title Fetching current expiry value from redis Fetching current expiry value May 17, 2018
@asppsa
Copy link
Collaborator

asppsa commented May 17, 2018

A roadblock for this is that memcached (one of the main supported stores with native expires support) has no equivalent of Redis' ttl command: memcached/memcached#239

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

No branches or pull requests

2 participants