From 5908252523be7032249ea412a05b23eb3b63641b Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@qq.com> Date: Tue, 6 Sep 2022 20:43:44 +0800 Subject: [PATCH] v3.8.668 fix: XPending bug #457 --- src/CSRedisCore/CSRedisCore.csproj | 2 +- src/CSRedisCore/Internal/ObjectPool/ObjectPool.cs | 9 +++++++++ .../Microsoft.Extensions.Caching.CSRedis.csproj | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/CSRedisCore/CSRedisCore.csproj b/src/CSRedisCore/CSRedisCore.csproj index fbb0aab..8d5e465 100644 --- a/src/CSRedisCore/CSRedisCore.csproj +++ b/src/CSRedisCore/CSRedisCore.csproj @@ -4,7 +4,7 @@ CSRedisCore CSRedisCore CSRedisCore - 3.8.666 + 3.8.668 true https://github.com/2881099/csredis CSRedis 是 redis.io 官方推荐库,支持 redis-trib集群、哨兵、私有分区与连接池管理技术,简易 RedisHelper 静态类。 diff --git a/src/CSRedisCore/Internal/ObjectPool/ObjectPool.cs b/src/CSRedisCore/Internal/ObjectPool/ObjectPool.cs index 9398d01..106a42c 100644 --- a/src/CSRedisCore/Internal/ObjectPool/ObjectPool.cs +++ b/src/CSRedisCore/Internal/ObjectPool/ObjectPool.cs @@ -116,6 +116,15 @@ private void CheckAvailable(int interval) try { + try + { + Policy.OnCheckAvailable(conn); + break; + } + catch + { + conn.ResetValue(); + } if (Policy.OnCheckAvailable(conn) == false) throw new Exception("CheckAvailable 应抛出异常,代表仍然不可用。"); break; } diff --git a/src/Microsoft.Extensions.Caching.CSRedis/Microsoft.Extensions.Caching.CSRedis.csproj b/src/Microsoft.Extensions.Caching.CSRedis/Microsoft.Extensions.Caching.CSRedis.csproj index c4f5236..5059f90 100644 --- a/src/Microsoft.Extensions.Caching.CSRedis/Microsoft.Extensions.Caching.CSRedis.csproj +++ b/src/Microsoft.Extensions.Caching.CSRedis/Microsoft.Extensions.Caching.CSRedis.csproj @@ -4,7 +4,7 @@ Caching.CSRedis Caching.CSRedis Caching.CSRedis - 3.8.666 + 3.8.668 true https://github.com/2881099/csredis/tree/master/src/Microsoft.Extensions.Caching.CSRedis/README.md 分布式缓存 CSRedisCore 实现 Microsoft.Extensions.Caching