mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add a 60 second keep-alive to connections
This commit is contained in:
@@ -49,11 +49,14 @@ pub struct Client {
|
|||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
fn connector() -> Connector {
|
fn connector() -> Connector {
|
||||||
|
let mut res = HttpConnector::new();
|
||||||
|
res.set_keepalive(Some(core::time::Duration::from_secs(60)));
|
||||||
#[cfg(feature = "tls")]
|
#[cfg(feature = "tls")]
|
||||||
let res =
|
let res = HttpsConnectorBuilder::new()
|
||||||
HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build();
|
.with_native_roots()
|
||||||
#[cfg(not(feature = "tls"))]
|
.https_or_http()
|
||||||
let res = HttpConnector::new();
|
.enable_http1()
|
||||||
|
.wrap_connector(res);
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user