Handling RedisCache is not connected.
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is your feature request related to a problem? Please describe.
https://github.com/StackExchange/StackExchange.Redis/issues/1120
https://github.com/StackExchange/StackExchange.Redis/issues/1322
Currently when there is an exception in connection, it throws an exception
https://github.com/dotnet/extensions/blob/3196f53061fcbe12fb2ebe81834124710d822a8d/src/Caching/StackExchangeRedis/src/RedisCache.cs#L173-L192
and during get
https://github.com/dotnet/extensions/blob/3196f53061fcbe12fb2ebe81834124710d822a8d/src/Caching/StackExchangeRedis/src/RedisCache.cs#L240
It will throw an exception as well.
### Describe the solution you'd like
I think we should try to establish the connection during initialization and provide an event for connection status. So we can somehow check if Redis cache is available before using it.
Contributor guide
Assessment
This issue has not been assessed yet.