MCPcopy Create free account
hub / github.com/brocode/fw / init_threads

Function init_threads

src/spawn/mod.rs:97–105  ·  view source on GitHub ↗
(parallel_raw: &Option<String>)

Source from the content-addressed store, hash-verified

95}
96
97pub fn init_threads(parallel_raw: &Option<String>) -> Result<(), AppError> {
98 if let Some(ref raw_num) = *parallel_raw {
99 let num_threads = raw_num.parse::<usize>()?;
100 rayon::ThreadPoolBuilder::new().num_threads(num_threads).build_global().expect(
101 "Tried to initialize rayon more than once (this is a software bug on fw side, please file an issue at https://github.com/brocode/fw/issues/new )",
102 );
103 }
104 Ok(())
105}
106
107pub fn foreach(maybe_config: Result<Config, AppError>, cmd: &str, tags: &BTreeSet<String>, parallel_raw: &Option<String>) -> Result<(), AppError> {
108 let config = maybe_config?;

Callers 2

autotagFunction · 0.85
foreachFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected