From 3dc4f98a2dc59d84586dbbb1893c40b3e492c81a Mon Sep 17 00:00:00 2001 From: Neel Goyal Date: Thu, 4 Jun 2015 11:02:18 -0400 Subject: [PATCH] Schedule a reconnect if connecting fails --- pool.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pool.c b/pool.c index 65ff84d..e5e29eb 100644 --- a/pool.c +++ b/pool.c @@ -8,6 +8,9 @@ #include #include +static void +pool_schedule_reconnect(struct pool* p); + struct pool * pool_new(struct worker *w, int count) { @@ -37,6 +40,9 @@ pool_on_connect(const redisAsyncContext *ac, int status) { int i = 0; if(!p || status == REDIS_ERR || ac->err) { + if (p) { + pool_schedule_reconnect(p); + } return; } /* connected to redis! */