django-redis-cache
django-redis-cache copied to clipboard
Add option to ignore Redis exceptions
It would be useful to have an option to ignore Redis exceptions, something like this:
CACHES = {
'default': {
'BACKEND': 'redis_cache.RedisCache',
'LOCATION': ['localhost:6379'],
'OPTIONS': {
'DB': 1,
'IGNORE_EXCEPTIONS': True,
},
},
}
For example, if you're using the cached_db session engine and Redis goes down, at the moment you will get an error on every page that needs login and tries to access the cache.
Would you be open to adding this feature? I've made a quick commit to show how would it look like.
+1. I think this is a good idea. I think also adding the ability to log on exception and specify the logger the way django-redis does would be very handy.