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

ability to specify health_check_interval for redis #425

Closed
L1ghtman2k opened this issue Dec 20, 2019 · 3 comments
Closed

ability to specify health_check_interval for redis #425

L1ghtman2k opened this issue Dec 20, 2019 · 3 comments

Comments

@L1ghtman2k
Copy link

L1ghtman2k commented Dec 20, 2019

I am currently running in issue where my Django web app periodically loses connection with my Redis. This seems due to the issue discussed in redis/redis-py#1140

something like the health_check_interval option would allow such a connection failure to be fixed.

@James-Quigley
Copy link

Also would like the ability to pass this kwarg, or maybe just arbitrary kwargs through to the redis-py connection

@esp4ik
Copy link

esp4ik commented May 1, 2020

+1

@L1ghtman2k L1ghtman2k reopened this May 1, 2020
@WisdomPill
Copy link
Member

Hello!

It is already possible to pass **kwargs to py-redis client.

Since when a connection has to be made in ConnectionFactory the REDIS_CLIENT_KWARGS are passed to Redis client.

You can do it with the following setting

CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': 'redis://localhost:6379',
        'OPTIONS': {
            "REDIS_CLIENT_KWARGS": {"health_check_interval": 30}
        }
    }
}

I am closing this, feel free to reopen if my answer did not help you

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

4 participants