Skip to content

Commit

Permalink
Enable -a (auth) option for redis-benchmark --cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
artix75 committed Dec 13, 2019
1 parent ba28738 commit 073806b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/redis-benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,18 @@ static int fetchClusterConfiguration() {
clusterNode *firstNode = createClusterNode((char *) config.hostip,
config.hostport);
if (!firstNode) {success = 0; goto cleanup;}
if (config.auth) {
reply = redisCommand(ctx, "AUTH %s", config.auth);
if (reply && reply->type == REDIS_REPLY_ERROR) {
if (config.hostsocket == NULL) {
fprintf(stderr, "Cluster node %s:%d replied with error:\n%s\n",
config.hostip, config.hostport, reply->str);
} else {
fprintf(stderr, "Cluster node %s replied with error:\n%s\n",
config.hostsocket, reply->str);
}
}
};
reply = redisCommand(ctx, "CLUSTER NODES");
success = (reply != NULL);
if (!success) goto cleanup;
Expand Down

0 comments on commit 073806b

Please sign in to comment.