passthru worker thread count from env

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-23 03:45:11 +00:00
parent 175e1c6453
commit 5f1cab6850
3 changed files with 13 additions and 9 deletions

View file

@ -5,7 +5,9 @@ use std::path::PathBuf;
use clap::Parser;
use conduit::{
config::{Figment, FigmentValue},
err, toml, Err, Result,
err, toml,
utils::available_parallelism,
Err, Result,
};
/// Commandline arguments
@ -32,6 +34,10 @@ pub(crate) struct Args {
/// Set functional testing modes if available. Ex '--test=smoke'
#[arg(long, hide(true))]
pub(crate) test: Vec<String>,
/// Override the tokio worker_thread count.
#[arg(long, hide(true), env = "TOKIO_WORKER_THREADS", default_value = available_parallelism().to_string())]
pub(crate) worker_threads: usize,
}
/// Parse commandline arguments into structured data