Merge pull request #32 from Cimpress-MCP/fix_redisHostIndex_inc

Move redisHostIndex inc to a finally
This commit is contained in:
Eric Fontana
2015-03-03 13:01:02 -05:00

View File

@@ -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++;
}