Retry http request on connection error (#922)

This commit is contained in:
Jiahao XU 2023-03-18 20:35:18 +11:00 committed by GitHub
parent 06b89b2d18
commit a6e52afaa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:#?}");