mirror of
https://github.com/chatmail/core.git
synced 2026-05-12 19:36:32 +03:00
Add timeouts to HTTP requests (#3908)
This commit is contained in:
12
src/http.rs
Normal file
12
src/http.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
//! # HTTP module.
|
||||
|
||||
use anyhow::Result;
|
||||
use std::time::Duration;
|
||||
|
||||
const HTTP_TIMEOUT: Duration = Duration::from_secs(30);
|
||||
|
||||
pub(crate) fn get_client() -> Result<reqwest::Client> {
|
||||
Ok(reqwest::ClientBuilder::new()
|
||||
.timeout(HTTP_TIMEOUT)
|
||||
.build()?)
|
||||
}
|
||||
Reference in New Issue
Block a user