Disconnect SUBSCRIBE users when Redis link is lost.

master
Nicolas Favre-Felix 14 years ago
parent b6d4c28d2f
commit 9f307f2ab7

@ -26,6 +26,9 @@ json_reply(redisAsyncContext *c, void *r, void *privdata) {
}
if (reply == NULL) {
if(client->started_responding) { /* broken, close */
http_send_reply_end(client);
}
return;
}

@ -108,9 +108,9 @@ disconnectCallback(const redisAsyncContext *c, int status) {
}
s->ac = NULL;
/* wait 10 msec and reconnect */
/* wait 100 msec and reconnect */
s->tv_reconnect.tv_sec = 0;
s->tv_reconnect.tv_usec = 100000;
s->tv_reconnect.tv_usec = 100*1000;
webdis_connect(s);
}
@ -121,11 +121,6 @@ on_timer_reconnect(int fd, short event, void *ctx) {
(void)event;
struct server *s = ctx;
if(s->ac) {
redisLibeventCleanup(s->ac->data);
redisFree((redisContext*)s->ac);
}
if(s->cfg->redis_host[0] == '/') { /* unix socket */
s->ac = redisAsyncConnectUnix(s->cfg->redis_host);
} else {

Loading…
Cancel
Save