From 5be31ca5bfa1be507a8294ae387101bbab650b47 Mon Sep 17 00:00:00 2001 From: Grant Lemons Date: Fri, 4 Oct 2024 13:56:04 -0600 Subject: [PATCH] fix(#198): limit tokio threads to 4 (+ main) --- harper-ls/src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/harper-ls/src/main.rs b/harper-ls/src/main.rs index 85619b2f..01d42e8f 100644 --- a/harper-ls/src/main.rs +++ b/harper-ls/src/main.rs @@ -31,7 +31,9 @@ struct Args { stdio: bool, } -#[tokio::main] +// Setting worker threads to 4 means the process will use about 5 threads total +// This is because worker threads do not include blocking threads +#[tokio::main(worker_threads = 4)] async fn main() -> anyhow::Result<()> { let subscriber = FmtSubscriber::builder() .map_writer(move |_| stderr)