Skip to content

Commit 9652ca5

Browse files
author
Mano Marks
authored
Merge pull request dockersamples#89 from oherrala/redisconn
Don't lose Redis connection on reconnect
2 parents 86aa3af + c2eeb7a commit 9652ca5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

worker/src/Worker/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public static int Main(string[] args)
3434
// Reconnect redis if down
3535
if (redisConn == null || !redisConn.IsConnected) {
3636
Console.WriteLine("Reconnecting Redis");
37-
redis = OpenRedisConnection("redis").GetDatabase();
37+
redisConn = OpenRedisConnection("redis");
38+
redis = redisConn.GetDatabase();
3839
}
3940
string json = redis.ListLeftPopAsync("votes").Result;
4041
if (json != null)

0 commit comments

Comments
 (0)