Skip to content

Commit d9909c9

Browse files
committed
Read HTTP max concurrent requests from config
1 parent fc6975c commit d9909c9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

app/buck2_common/src/init.rs

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct HttpConfig {
5858
write_timeout_ms: Option<u64>,
5959
pub http2: bool,
6060
pub max_redirects: Option<usize>,
61+
pub max_concurrent_requests: Option<usize>,
6162
}
6263

6364
impl HttpConfig {
@@ -84,13 +85,18 @@ impl HttpConfig {
8485
property: "http2",
8586
})?
8687
.unwrap_or(true);
88+
let max_concurrent_requests = config.parse(BuckconfigKeyRef {
89+
section: "http",
90+
property: "max_concurrent_requests",
91+
})?;
8792

8893
Ok(Self {
8994
connect_timeout_ms,
9095
read_timeout_ms,
9196
write_timeout_ms,
9297
max_redirects,
9398
http2,
99+
max_concurrent_requests,
94100
})
95101
}
96102

app/buck2_server/src/daemon/state.rs

+3
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,9 @@ async fn http_client_from_startup_config(
953953
}
954954
_ => {}
955955
}
956+
if let Some(n) = config.http.max_concurrent_requests {
957+
builder.with_max_concurrent_requests(n);
958+
}
956959

957960
Ok(builder)
958961
}

0 commit comments

Comments
 (0)