Enable connection timeouts for requests
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
ci/woodpecker/push/ociImagePush Pipeline was successful
Details
Hopefully reducing congestion
This commit is contained in:
parent
dab7585a8b
commit
277dcb5e3e
|
@ -4,6 +4,7 @@ use headers::UserAgent;
|
||||||
use hyper::body::Bytes;
|
use hyper::body::Bytes;
|
||||||
use reqwest::{redirect::Policy, Client, RequestBuilder};
|
use reqwest::{redirect::Policy, Client, RequestBuilder};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
use std::time::Duration;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
use tokio::pin;
|
use tokio::pin;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
@ -58,6 +59,7 @@ impl FederationClient {
|
||||||
let client = Client::builder()
|
let client = Client::builder()
|
||||||
.https_only(force_https)
|
.https_only(force_https)
|
||||||
.redirect(Policy::limited(5))
|
.redirect(Policy::limited(5))
|
||||||
|
.connect_timeout(Duration::from_secs(timeout_seconds))
|
||||||
.build()?;
|
.build()?;
|
||||||
|
|
||||||
Ok(FederationClient {
|
Ok(FederationClient {
|
||||||
|
|
|
@ -15,7 +15,7 @@ pub(super) fn new_federation_client_service(
|
||||||
FederationClient::new(
|
FederationClient::new(
|
||||||
true,
|
true,
|
||||||
256000,
|
256000,
|
||||||
35,
|
25,
|
||||||
UserAgent::from_str(&format!(
|
UserAgent::from_str(&format!(
|
||||||
"magnetar/{} (https://{})",
|
"magnetar/{} (https://{})",
|
||||||
config.branding.version, config.networking.host
|
config.branding.version, config.networking.host
|
||||||
|
|
Loading…
Reference in New Issue