File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -1017,6 +1017,7 @@ impl PoolRefiller {
10171017 let mut conns = self . conns . clone ( ) ;
10181018 let keyspace_name = keyspace_name. clone ( ) ;
10191019 let address = self . address ;
1020+ let connect_timeout = self . pool_config . connection_config . connect_timeout ;
10201021
10211022 let fut = async move {
10221023 let mut use_keyspace_futures = Vec :: new ( ) ;
@@ -1032,8 +1033,12 @@ impl PoolRefiller {
10321033 return Ok ( ( ) ) ;
10331034 }
10341035
1035- let use_keyspace_results: Vec < Result < ( ) , QueryError > > =
1036- futures:: future:: join_all ( use_keyspace_futures) . await ;
1036+ let use_keyspace_results: Vec < Result < ( ) , QueryError > > = tokio:: time:: timeout (
1037+ connect_timeout,
1038+ futures:: future:: join_all ( use_keyspace_futures) ,
1039+ )
1040+ . await
1041+ . map_err ( |_| QueryError :: TimeoutError ) ?;
10371042
10381043 // If there was at least one Ok and the rest were IoErrors we can return Ok
10391044 // keyspace name is correct and will be used on broken connection on the next reconnect
You can’t perform that action at this time.
0 commit comments