aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/record/sync.rs
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@elliehuxtable.com>2023-09-18 08:39:19 +0100
committerGitHub <noreply@github.com>2023-09-18 08:39:19 +0100
commit351b3e8a57c9e0143b7b6f3ed2160dcdce00225e (patch)
treeb8d91a569daf2d819eea7a92e977458a3f3394a6 /atuin-client/src/record/sync.rs
parentfeat(keyup): Configure SearchMode for KeyUp invocation #1216 (#1224) (diff)
downloadatuin-351b3e8a57c9e0143b7b6f3ed2160dcdce00225e.zip
Add connect timeout and overall timeout (#1238)
* Add connect timeout and overall timeout * Make it configurable * Fix test * Add docs
Diffstat (limited to 'atuin-client/src/record/sync.rs')
-rw-r--r--atuin-client/src/record/sync.rs14
1 files changed, 12 insertions, 2 deletions
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<Diff>, 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;