-
Notifications
You must be signed in to change notification settings - Fork 333
Closed
Labels
Description
Description
I used asp.net core 3.1 application with EasyCaching.Redis 1.2.1
EasyCaching.Redis.RedisDatabaseProvider works badlly if redis not available in first request.
Steps to Reproduce
- stop redis
- run application
- request to cache (easycaching) -> exception
- start redis
- request to cache -> exception
Related code
for my opinion problem here
private readonly Lazy<ConnectionMultiplexer> _connectionMultiplexer;
works correctly if implement like this
private Lazy<ConnectionMultiplexer> _connectionMultiplexer;
...
public IDatabase GetDatabase()
{
try
{
return _connectionMultiplexer.Value.GetDatabase();
}
catch (Exception)
{
_connectionMultiplexer = new Lazy<ConnectionMultiplexer>(CreateConnectionMultiplexer);
throw;
}
}
Expected behavior: [What you expected to happen]
I expected cache will be work if redis available
Actual behavior: [What actually happened]
cache response exception
Specifications
- Provider : EasyCaching.Redis 1.2.1
- Interceptor : asp.net core 3.1
- Serializer : msgpack
- System : window 10