Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix(#198): limit tokio threads to 4 (+ main)

Grant Lemons5be31ca5bfa1
diff --git a/harper-ls/src/main.rs b/harper-ls/src/main.rs
index 85619b2fa..01d42e8fb 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)