Skip to content

Commit 54c6db4

Browse files
committed
Limit Tokio worker threads to I/O thread count
1 parent 34fd7c6 commit 54c6db4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/rustup-init.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ fn main() -> Result<ExitCode> {
4040
#[cfg(windows)]
4141
pre_rustup_main_init();
4242

43+
let process = Process::os();
4344
let runtime = tokio::runtime::Builder::new_multi_thread()
4445
.enable_all()
46+
.worker_threads(process.io_thread_count()?)
4547
.build()
4648
.unwrap();
4749

48-
let process = Process::os();
4950
let result = runtime.block_on(async {
5051
#[cfg(feature = "otel")]
5152
let _telemetry_guard = log::set_global_telemetry();

0 commit comments

Comments
 (0)