Skip to content

Commit

Permalink
v1.1.9 fix: ObjectPool SetUnavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Sep 7, 2023
1 parent 57a7b18 commit cf8a086
Show file tree
Hide file tree
Showing 4 changed files with 439 additions and 287 deletions.
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>1.1.8</Version>
<Version>1.1.9</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
4 changes: 2 additions & 2 deletions src/FreeRedis/IRedisClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public interface IRedisClient
long JsonForget(string key, string path = "$");
string JsonNumIncrBy(string key, string path, Double value);
string JsonNumMultBy(string key, string path, Double value);
string[] JsonObjKeys(string key, string path = "$");
string[][] JsonObjKeys(string key, string path = "$");
long[] JsonObjLen(string key, string path = "$");
object[][] JsonResp(string key, string path = "$");
long[] JsonStrAppend(string key, string value, string path = "$");
Expand Down Expand Up @@ -553,7 +553,7 @@ public interface IRedisClient
Task<ZMember[]> ZPopMinAsync(string key, int count);
Task<ZMember> ZPopMaxAsync(string key);
Task<ZMember[]> ZPopMaxAsync(string key, int count);
Task<string[]> JsonObjKeysAsync(string key, string path = "$");
Task<string[][]> JsonObjKeysAsync(string key, string path = "$");
Task<long[]> JsonObjLenAsync(string key, string path = "$");
Task<object[][]> JsonRespAsync(string key, string path = "$");
Task<long[]> JsonStrAppendAsync(string key, string value, string path = "$");
Expand Down
5 changes: 2 additions & 3 deletions src/FreeRedis/Internal/ObjectPool/ObjectPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ private void RestoreToAvailable()
{
if (UnavailableException != null)
{
lock (_allObjectsLock)
_allObjects.ForEach(a => a.LastGetTime = a.LastReturnTime = new DateTime(2000, 1, 1));
UnavailableException = null;
UnavailableTime = null;
AvailableTime = DateTime.Now;
Expand All @@ -164,9 +166,6 @@ private void RestoreToAvailable()

if (isRestored)
{
lock (_allObjectsLock)
_allObjects.ForEach(a => a.LastGetTime = a.LastReturnTime = new DateTime(2000, 1, 1));

Policy.OnAvailable();
TestTrace.WriteLine($"{Policy.Name}】Recovered", ConsoleColor.DarkGreen);
}
Expand Down
Loading

0 comments on commit cf8a086

Please sign in to comment.