Merge pull request #32 from Cimpress-MCP/fix_redisHostIndex_inc
Move redisHostIndex inc to a finally
This commit is contained in:
@@ -60,16 +60,17 @@ namespace TimberWinR.Outputs
|
||||
try
|
||||
{
|
||||
RedisClient client = new RedisClient(_redisHosts[_redisHostIndex], _port, _timeout);
|
||||
|
||||
_redisHostIndex++;
|
||||
if (_redisHostIndex >= _redisHosts.Length)
|
||||
_redisHostIndex = 0;
|
||||
|
||||
return client;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
_redisHostIndex++;
|
||||
if (_redisHostIndex >= _redisHosts.Length)
|
||||
_redisHostIndex = 0;
|
||||
}
|
||||
numTries++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user