Merge pull request #89 from oherrala/redisconn
Don't lose Redis connection on reconnect
This commit is contained in:
commit
9652ca5e1c
@ -34,7 +34,8 @@ namespace Worker
|
|||||||
// Reconnect redis if down
|
// Reconnect redis if down
|
||||||
if (redisConn == null || !redisConn.IsConnected) {
|
if (redisConn == null || !redisConn.IsConnected) {
|
||||||
Console.WriteLine("Reconnecting Redis");
|
Console.WriteLine("Reconnecting Redis");
|
||||||
redis = OpenRedisConnection("redis").GetDatabase();
|
redisConn = OpenRedisConnection("redis");
|
||||||
|
redis = redisConn.GetDatabase();
|
||||||
}
|
}
|
||||||
string json = redis.ListLeftPopAsync("votes").Result;
|
string json = redis.ListLeftPopAsync("votes").Result;
|
||||||
if (json != null)
|
if (json != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user