mirror of
https://github.com/serai-dex/serai.git
synced 2025-04-13 09:41:57 +00:00
Add a 60 second keep-alive to connections
This commit is contained in:
parent
cbde0d8be9
commit
7d2c47f3d4
1 changed files with 7 additions and 4 deletions
|
@ -49,11 +49,14 @@ pub struct Client {
|
|||
|
||||
impl Client {
|
||||
fn connector() -> Connector {
|
||||
let mut res = HttpConnector::new();
|
||||
res.set_keepalive(Some(core::time::Duration::from_secs(60)));
|
||||
#[cfg(feature = "tls")]
|
||||
let res =
|
||||
HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build();
|
||||
#[cfg(not(feature = "tls"))]
|
||||
let res = HttpConnector::new();
|
||||
let res = HttpsConnectorBuilder::new()
|
||||
.with_native_roots()
|
||||
.https_or_http()
|
||||
.enable_http1()
|
||||
.wrap_connector(res);
|
||||
res
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue