From 7b45d72b970430fc143983eba733ac9e1f5c8474 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Wed, 1 May 2019 16:37:51 +0200 Subject: [PATCH] Make worker threads configurable --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2273028..49c20f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -101,6 +101,9 @@ struct Opt { #[structopt(short = "d", long = "domain", default_value = "hitsofcode.com")] /// Interface to listen on domain: String, + #[structopt(short = "w", long = "workers", default_value = "4")] + /// Number of worker threads + workers: usize, } fn pull(path: impl AsRef) -> Result<(), Error> { @@ -348,7 +351,7 @@ fn main() -> std::io::Result<()> { .service(web::resource("/view/bitbucket/{user}/{repo}").to(overview::)) .default_service(web::resource("").route(web::get().to(p404))) }) - .workers(4) + .workers(OPT.workers) .bind(interface)? .run() }