Skip to content

Commit

Permalink
Merge pull request #288 from shachlanAmazon/use-fork
Browse files Browse the repository at this point in the history
Use fork with connection timeout.
  • Loading branch information
shachlanAmazon authored Jun 22, 2023
2 parents b60111d + 0cc8e43 commit c144135
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion babushka-core/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl BabushkaClient for Client {}

pub const DEFAULT_RESPONSE_TIMEOUT: Duration = Duration::from_millis(250);
pub const DEFAULT_CONNECTION_ATTEMPT_TIMEOUT: Duration = Duration::from_millis(250);
pub const INTERNAL_CONNECTION_TIMEOUT: Duration = Duration::from_millis(250);

pub(super) fn get_port(address: &AddressInfo) -> u16 {
const DEFAULT_PORT: u16 = 6379;
Expand Down Expand Up @@ -159,7 +160,8 @@ async fn create_cluster_client(
.into_iter()
.map(|address| get_connection_info(&address, tls_mode, redis_connection_info.clone()))
.collect();
let mut builder = redis::cluster::ClusterClientBuilder::new(initial_nodes);
let mut builder = redis::cluster::ClusterClientBuilder::new(initial_nodes)
.connection_timeout(INTERNAL_CONNECTION_TIMEOUT);
if tls_mode != TlsMode::NoTls {
let tls = if tls_mode == TlsMode::SecureTls {
redis::cluster::TlsMode::Secure
Expand Down

0 comments on commit c144135

Please sign in to comment.