Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 44 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion openstack_sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ json-patch = { workspace = true }
lazy_static = { workspace = true }
open.workspace = true
regex = { workspace = true }
reqwest = { workspace = true }
reqwest = { workspace = true, features = ["gzip", "deflate", "http2",
"system-proxy"] }
secrecy = { version = "0.10", features = ["serde"] }
serde = { workspace = true }
serde_json = {workspace = true}
Expand Down
15 changes: 14 additions & 1 deletion openstack_sdk/src/openstack_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use http::{header, HeaderMap, HeaderValue, Response as HttpResponse, StatusCode}
use reqwest::{Body, Certificate, Client as AsyncClient, Request, Response};
use std::convert::TryInto;
use std::fmt::{self, Debug};
use std::time::SystemTime;
use std::time::{Duration, SystemTime};
use std::{fs::File, io::Read};
use tokio_util::codec;
use tokio_util::compat::FuturesAsyncReadCompatExt;
Expand Down Expand Up @@ -193,6 +193,19 @@ impl AsyncOpenStack {
);
client_builder = client_builder.danger_accept_invalid_certs(true);
}
client_builder = client_builder.pool_max_idle_per_host(10);
client_builder = client_builder.pool_idle_timeout(Duration::from_secs(30));
client_builder = client_builder.timeout(Duration::from_secs(
config
.options
.get("api_timeout")
.and_then(|val| val.clone().into_uint().ok())
.unwrap_or(30),
));
client_builder = client_builder.connect_timeout(Duration::from_secs(5));
client_builder = client_builder.tcp_keepalive(Duration::from_secs(60));
client_builder = client_builder.gzip(true);
client_builder = client_builder.deflate(true);

let mut session = AsyncOpenStack {
client: client_builder.build()?,
Expand Down