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

get_or_set() is not compatible with get() #182

Open
WinnieP opened this issue Dec 5, 2019 · 0 comments
Open

get_or_set() is not compatible with get() #182

WinnieP opened this issue Dec 5, 2019 · 0 comments

Comments

@WinnieP
Copy link

WinnieP commented Dec 5, 2019

If you get_or_set() with a timeout, the value is still retrievable with get() even after it expires. The expectation seems to be that a key set in this way is always retrieved with get_or_set(), and it's fresh_key that expires, not the underlying key.

Also, without stale_cache_timeout, the actual key will have no expiration which is not what I'd expect from default behavior.

cache.get_or_set('foo', lambda: 'bar', 10)
# wait over 10 seconds
cache.get('foo') # returns 'bar'
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

1 participant