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 cache searches unversioned key before fallback #122

Open
AlexRiina opened this issue Oct 5, 2016 · 0 comments
Open

get_or_set cache searches unversioned key before fallback #122

AlexRiina opened this issue Oct 5, 2016 · 0 comments

Comments

@AlexRiina
Copy link

AlexRiina commented Oct 5, 2016

In my django shell, I can run the following

cache.set('x', 'yay', version=2)
cache.set('x', 'boo')

cache.get_or_set('x', lambda: 'x', version=2)
> 'boo'  # should be 'yay'

cache.get('x')
> 'yay'

It looks like a simple mistake here where it should be

- self.get(key._original_key)
+ self.get(key)

This line looks like it may also be using _original_key incorrectly. I assume redis.ResponseError is raised due to running a version of redis that doesn't support incr and that it would then manually fetch and increment the wrong key.

@AlexRiina AlexRiina changed the title get_or_set cache searchs unversioned key before fallback get_or_set cache searches unversioned key before fallback Nov 16, 2016
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