Skip to content

Commit

Permalink
v0.6.6 CheckAvailable retry
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Sep 6, 2022
1 parent 8402a19 commit e0ca0cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/FreeRedis/FreeRedis.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>FreeRedis</AssemblyName>
<PackageId>FreeRedis</PackageId>
<RootNamespace>FreeRedis</RootNamespace>
<Version>0.6.5</Version>
<Version>0.6.6</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageProjectUrl>https://github.com/2881099/FreeRedis</PackageProjectUrl>
<Description>FreeRedis is .NET redis client, supports cluster, sentinel, master-slave, pipeline, transaction and connection pool.</Description>
Expand Down
9 changes: 9 additions & 0 deletions src/FreeRedis/Internal/ObjectPool/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e0ca0cc

Please sign in to comment.