Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 38c192d

Browse files
committed
use existing approach for retrieving next index
1 parent c94eedd commit 38c192d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ServiceStack.Redis/RedisManagerPool.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,9 @@ public IRedisClient GetClient()
123123
while ((inActiveClient = GetInActiveClient()) == null)
124124
{
125125
//Create new client outside of pool when max pool size exceeded
126-
var nextIndex = poolIndex % Hosts.Count;
127-
var nextHost = Hosts[nextIndex];
126+
var desiredIndex = poolIndex % clients.Length;
127+
var nextHostIndex = desiredIndex % Hosts.Count;
128+
var nextHost = Hosts[nextHostIndex];
128129
var newClient = InitNewClient(nextHost);
129130
//Don't handle callbacks for new client outside pool
130131
newClient.ClientManager = null;

0 commit comments

Comments
 (0)