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

django-redis-cache get_or_set() method is unreachable #185

Open
ad-65 opened this issue Jan 17, 2020 · 0 comments
Open

django-redis-cache get_or_set() method is unreachable #185

ad-65 opened this issue Jan 17, 2020 · 0 comments

Comments

@ad-65
Copy link

ad-65 commented Jan 17, 2020

Using:

Django==3.0.2
django-redis-cache==2.1.0

Configure django-redis-cache per the docs:

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': 'redis://localhost:6379/0',
        'TIMEOUT': 300,
    },
}

Then try:

cache.get_or_set('key', 'non-callable value')

Everything actually works, but django-redis-cache should raise an exception when a non-callable is passed.

It seems that when Django added a get_or_set() method it is now overriding the django-redis-cache get_or_set() method. This would remove the advantage of the built in "thundering herd protection" and is confusing.

Thanks.

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