feat: introduce timeouts for outgoing requests
This commit is contained in:
parent
6a6a340618
commit
32b7870bf2
1 changed files with 3 additions and 0 deletions
|
@ -102,6 +102,9 @@ pub trait Fetcher {
|
||||||
fn client(domain: &str) -> reqwest::Client {
|
fn client(domain: &str) -> reqwest::Client {
|
||||||
reqwest::Client::builder()
|
reqwest::Client::builder()
|
||||||
.user_agent(format!("upub+{} ({domain})", crate::VERSION))
|
.user_agent(format!("upub+{} ({domain})", crate::VERSION))
|
||||||
|
.connect_timeout(std::time::Duration::from_secs(30)) // TODO may be cool to configure these
|
||||||
|
.read_timeout(std::time::Duration::from_secs(30)) // TODO may be cool to configure these
|
||||||
|
.timeout(std::time::Duration::from_secs(300)) // TODO may be cool to configure these
|
||||||
.build()
|
.build()
|
||||||
.expect("failed building http client, check system tls or resolver")
|
.expect("failed building http client, check system tls or resolver")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue