dotnet / dotnet/aspnetcore

Handling RedisCache is not connected.

Open
#28,372 1 comment 2 reactions 0 assignees View on GitHub
area-middleware enhancement feature-caching
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.