From 351b3e8a57c9e0143b7b6f3ed2160dcdce00225e Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 18 Sep 2023 08:39:19 +0100 Subject: Add connect timeout and overall timeout (#1238) * Add connect timeout and overall timeout * Make it configurable * Fix test * Add docs --- atuin-client/src/record/sync.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'atuin-client/src/record/sync.rs') diff --git a/atuin-client/src/record/sync.rs b/atuin-client/src/record/sync.rs index ad9079ed..56be0638 100644 --- a/atuin-client/src/record/sync.rs +++ b/atuin-client/src/record/sync.rs @@ -22,7 +22,12 @@ pub enum Operation { } pub async fn diff(settings: &Settings, store: &mut impl Store) -> Result<(Vec, RecordIndex)> { - let client = Client::new(&settings.sync_address, &settings.session_token)?; + let client = Client::new( + &settings.sync_address, + &settings.session_token, + settings.network_connect_timeout, + settings.network_timeout, + )?; let local_index = store.tail_records().await?; let remote_index = client.record_index().await?; @@ -218,7 +223,12 @@ pub async fn sync_remote( local_store: &mut impl Store, settings: &Settings, ) -> Result<(i64, i64)> { - let client = Client::new(&settings.sync_address, &settings.session_token)?; + let client = Client::new( + &settings.sync_address, + &settings.session_token, + settings.network_connect_timeout, + settings.network_timeout, + )?; let mut uploaded = 0; let mut downloaded = 0; -- cgit v1.3.1