Переглянути джерело

ndb_redis: fix cluster support

fixes #2461 related #2300
Victor Seva 5 роки тому
батько
коміт
5557b9b715
1 змінених файлів з 7 додано та 13 видалено
  1. 7 13
      src/modules/ndb_redis/redis_client.c

+ 7 - 13
src/modules/ndb_redis/redis_client.c

@@ -1032,13 +1032,6 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 		}
 	}
 
-	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
-	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
-		LM_ERR("Redis error:%.*s\n",
-			(int)rpl->rplRedis->len, rpl->rplRedis->str);
-		goto error_exec;
-	}
-
 	if (check_cluster_reply(rpl->rplRedis, &rsrv)) {
 		LM_DBG("rsrv->ctxRedis = %p\n", rsrv->ctxRedis);
 		if(rsrv->ctxRedis==NULL)
@@ -1073,14 +1066,15 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
 				goto error_exec;
 			}
 		}
+	}
 
-		LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
-		if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
-			LM_ERR("Redis error:%.*s\n",
-				(int)rpl->rplRedis->len, rpl->rplRedis->str);
-			goto error_exec;
-		}
+	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
+	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
+		LM_ERR("Redis error:%.*s\n",
+			(int)rpl->rplRedis->len, rpl->rplRedis->str);
+		goto error_exec;
 	}
+
 	STR_ZTOV(cmd->s[cmd->len], c);
 	rsrv->disable.consecutive_errors = 0;
 	va_end(ap);