Skip to content

Commit

Permalink
Remove call to reqwest::ClientBuilder::pool_max_idle_per_host() on wa…
Browse files Browse the repository at this point in the history
…sm (#1555)
  • Loading branch information
johnbatty authored Jan 8, 2024
1 parent 9b2bd2e commit f75406d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sdk/core/src/http_client/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ pub fn new_reqwest_client() -> Arc<dyn HttpClient> {
// `hyper` library that causes the `reqwest` client to hang in some cases.
//
// See <https://github.com/hyperium/hyper/issues/2312> for more details.
#[cfg(not(target_arch = "wasm32"))]
let client = ::reqwest::ClientBuilder::new()
.pool_max_idle_per_host(0)
.build()
.expect("failed to build `reqwest` client");

// `reqwest` does not implement `pool_max_idle_per_host()` on WASM.
#[cfg(target_arch = "wasm32")]
let client = ::reqwest::ClientBuilder::new()
.build()
.expect("failed to build `reqwest` client");

Arc::new(client)
}

Expand Down

0 comments on commit f75406d

Please sign in to comment.