diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2023-09-18 08:39:19 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-18 08:39:19 +0100 |
| commit | 351b3e8a57c9e0143b7b6f3ed2160dcdce00225e (patch) | |
| tree | b8d91a569daf2d819eea7a92e977458a3f3394a6 /atuin-client/src/record | |
| parent | feat(keyup): Configure SearchMode for KeyUp invocation #1216 (#1224) (diff) | |
| download | atuin-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')
| -rw-r--r-- | atuin-client/src/record/sync.rs | 14 |
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; |
