Skip to content

Commit

Permalink
use pool_idle_timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mon-ius committed May 13, 2024
1 parent 0e9ab70 commit 86a3fab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hfd-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async fn download_chunk(
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let client= reqwest::Client::builder()
.default_headers(headers.clone())
.pool_max_idle_per_host(0)
.pool_idle_timeout(Duration::from_secs(1))
.build()?;

let range = format!("bytes={s}-{e}");
Expand All @@ -113,7 +113,7 @@ async fn download(
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
let client = reqwest::Client::builder()
.default_headers(headers.clone())
.pool_max_idle_per_host(0)
.pool_idle_timeout(Duration::from_secs(1))
.build()?;

let response = client.get(&url).header(RANGE, "bytes=0-0").send().await?;
Expand Down Expand Up @@ -185,7 +185,7 @@ impl HfClient {

async fn list_files(&self) -> Result<Vec<String>, Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.pool_max_idle_per_host(0)
.pool_idle_timeout(Duration::from_secs(1))
.build()?;
let api = self.hf_url.api();
let response = client.get(api)
Expand Down

0 comments on commit 86a3fab

Please sign in to comment.