Call aeStop on error conditions

This commit is contained in:
Pieter Noordhuis 2013-07-10 21:08:15 -07:00
parent fc55afb1b6
commit af9bf16953

View File

@ -21,18 +21,21 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) {
void connectCallback(const redisAsyncContext *c, int status) { void connectCallback(const redisAsyncContext *c, int status) {
if (status != REDIS_OK) { if (status != REDIS_OK) {
printf("Error: %s\n", c->errstr); printf("Error: %s\n", c->errstr);
aeStop(loop);
return; return;
} }
printf("Connected...\n"); printf("Connected...\n");
} }
void disconnectCallback(const redisAsyncContext *c, int status) { void disconnectCallback(const redisAsyncContext *c, int status) {
if (status != REDIS_OK) { if (status != REDIS_OK) {
printf("Error: %s\n", c->errstr); printf("Error: %s\n", c->errstr);
aeStop(loop);
return; return;
} }
printf("Disconnected...\n");
printf("Disconnected...\n");
aeStop(loop); aeStop(loop);
} }