Browse code

ndb_redis: fix cluster support

fixes #2461 related #2300

Victor Seva authored on 21/09/2020 07:49:25
Showing 1 changed files
... ...
@@ -1032,13 +1032,6 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
1032 1032
 		}
1033 1033
 	}
1034 1034
 
1035
-	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
1036
-	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
1037
-		LM_ERR("Redis error:%.*s\n",
1038
-			(int)rpl->rplRedis->len, rpl->rplRedis->str);
1039
-		goto error_exec;
1040
-	}
1041
-
1042 1035
 	if (check_cluster_reply(rpl->rplRedis, &rsrv)) {
1043 1036
 		LM_DBG("rsrv->ctxRedis = %p\n", rsrv->ctxRedis);
1044 1037
 		if(rsrv->ctxRedis==NULL)
... ...
@@ -1073,14 +1066,15 @@ int redisc_exec(str *srv, str *res, str *cmd, ...)
1073 1066
 				goto error_exec;
1074 1067
 			}
1075 1068
 		}
1069
+	}
1076 1070
 
1077
-		LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
1078
-		if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
1079
-			LM_ERR("Redis error:%.*s\n",
1080
-				(int)rpl->rplRedis->len, rpl->rplRedis->str);
1081
-			goto error_exec;
1082
-		}
1071
+	LM_DBG("rpl->rplRedis->type:%d\n", rpl->rplRedis->type);
1072
+	if(rpl->rplRedis->type == REDIS_REPLY_ERROR) {
1073
+		LM_ERR("Redis error:%.*s\n",
1074
+			(int)rpl->rplRedis->len, rpl->rplRedis->str);
1075
+		goto error_exec;
1083 1076
 	}
1077
+
1084 1078
 	STR_ZTOV(cmd->s[cmd->len], c);
1085 1079
 	rsrv->disable.consecutive_errors = 0;
1086 1080
 	va_end(ap);