1

I am using the django-redis package version (4.12.1),

I am getting a TimeOut Exception(Intermittent issue) while reading data from the Redis cache, I would like to Retry for some N number of times to fetch the data

I tried using these settings but retry is not happening "REDIS_CLIENT_KWARGS": {"retry_on_timeout": True}

Please let me know if any other settings are available to retry while reading data from Redis using the django-redis package.

Example Code: cache.get("mykey"), getting time out exception here

cache settings in my project:

CACHES = {
    'default': {
        'BACKEND': 'django_redis.cache.RedisCache',
        'LOCATION': 'redis_server_url',
        'OPTIONS': {
            'CLIENT_CLASS': 'django_redis.client.DefaultClient',
            'REDIS_CLIENT_KWARGS': {'ssl': True},
            'CONNECTION_POOL_KWARGS': {'ssl_cert_reqs': False},
            'SOCKET_TIMEOUT':4,
            'SOCKET_CONNECT_TIMEOUT':4
        }
    }
}
Sai Prasad Goud
  • 199
  • 1
  • 7

0 Answers0