File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2524,7 +2524,10 @@ static int clusterManagerExecTransaction(clusterManagerNode *node,
25242524
25252525static int clusterManagerNodeConnect (clusterManagerNode * node ) {
25262526 if (node -> context ) redisFree (node -> context );
2527- node -> context = redisConnect (node -> ip , node -> port );
2527+ struct timeval tv ;
2528+ tv .tv_sec = config .cluster_manager_command .timeout / 1000 ;
2529+ tv .tv_usec = (config .cluster_manager_command .timeout % 1000 ) * 1000 ;
2530+ node -> context = redisConnectWithTimeout (node -> ip , node -> port , tv );
25282531 if (!node -> context -> err && config .tls ) {
25292532 const char * err = NULL ;
25302533 if (cliSecureConnection (node -> context , config .sslconfig , & err ) == REDIS_ERR && err ) {
@@ -5626,7 +5629,10 @@ static int clusterManagerCommandImport(int argc, char **argv) {
56265629 char * reply_err = NULL ;
56275630 redisReply * src_reply = NULL ;
56285631 // Connect to the source node.
5629- redisContext * src_ctx = redisConnect (src_ip , src_port );
5632+ struct timeval tv ;
5633+ tv .tv_sec = config .cluster_manager_command .timeout / 1000 ;
5634+ tv .tv_usec = (config .cluster_manager_command .timeout % 1000 ) * 1000 ;
5635+ redisContext * src_ctx = redisConnectWithTimeout (src_ip , src_port , tv );
56305636 if (src_ctx -> err ) {
56315637 success = 0 ;
56325638 fprintf (stderr ,"Could not connect to KeyDB at %s:%d: %s.\n" , src_ip ,
You can’t perform that action at this time.
0 commit comments