Skip to content

Commit

Permalink
Rename internal func _valkeyClusterConnect()
Browse files Browse the repository at this point in the history
Signed-off-by: Björn Svensson <[email protected]>
  • Loading branch information
bjosv committed Jun 29, 2024
1 parent 0cc4f65 commit f76825c
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 @@ -1416,21 +1416,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 @@ -1445,7 +1436,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 @@ -1470,7 +1461,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 f76825c

Please sign in to comment.