Skip to content

Commit

Permalink
Rename _valkeyClusterConnect()
Browse files Browse the repository at this point in the history
  • Loading branch information
bjosv committed Jun 21, 2024
1 parent b425b4d commit 66c921a
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/valkeycluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1540,21 +1540,12 @@ void valkeyClusterFree(valkeyClusterContext *cc) {
vk_free(cc);
}

/* Connect to a Valkey cluster. On error the field error in the returned
* context will be set to the return value of the error function.
* When no set of reply functions is given, the default set will be used. */
static valkeyClusterContext *_valkeyClusterConnect(valkeyClusterContext *cc,
const char *addrs) {

int ret;

ret = valkeyClusterSetOptionAddNodes(cc, addrs);
if (ret != VALKEY_OK) {
static valkeyClusterContext *
valkeyClusterConnectInternal(valkeyClusterContext *cc, const char *addrs) {
if (valkeyClusterSetOptionAddNodes(cc, addrs) != VALKEY_OK) {
return cc;
}

valkeyClusterUpdateSlotmap(cc);

return cc;
}

Expand All @@ -1569,7 +1560,7 @@ valkeyClusterContext *valkeyClusterConnect(const char *addrs, int flags) {

cc->flags = flags;

return _valkeyClusterConnect(cc, addrs);
return valkeyClusterConnectInternal(cc, addrs);
}

valkeyClusterContext *valkeyClusterConnectWithTimeout(const char *addrs,
Expand All @@ -1594,7 +1585,7 @@ valkeyClusterContext *valkeyClusterConnectWithTimeout(const char *addrs,

memcpy(cc->connect_timeout, &tv, sizeof(struct timeval));

return _valkeyClusterConnect(cc, addrs);
return valkeyClusterConnectInternal(cc, addrs);
}

int valkeyClusterSetOptionAddNode(valkeyClusterContext *cc, const char *addr) {
Expand Down

0 comments on commit 66c921a

Please sign in to comment.