From a6e52afaa0ec57713b81d56043ece3b7a652cc61 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Mar 2023 20:35:18 +1100 Subject: [PATCH] Retry http request on connection error (#922) --- crates/binstalk-downloader/src/remote.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 09564d9a..24e18a5b 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -147,7 +147,7 @@ impl Client { let future = (&self.0.service).ready().await?.call(request); let response = match future.await { - Err(err) if err.is_timeout() => { + Err(err) if err.is_timeout() || err.is_connect() => { let duration = RETRY_DURATION_FOR_TIMEOUT; info!("Received timeout error from reqwest. Delay future request by {duration:#?}");