Skip to content

Commit

Permalink
fix(cli): actually apply threads option (#9527)
Browse files Browse the repository at this point in the history
Closes #9416

Signed-off-by: Luke Steensen <[email protected]>
  • Loading branch information
lukesteensen authored Oct 8, 2021
1 parent 79c266f commit 74c3f06
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,19 @@ impl Application {

metrics::init_global().expect("metrics initialization failed");

let mut rt_builder = runtime::Builder::new_multi_thread();
rt_builder.enable_all().thread_name("vector-worker");

if let Some(threads) = root_opts.threads {
if threads < 1 {
error!("The `threads` argument must be greater or equal to 1.");
return Err(exitcode::CONFIG);
} else {
rt_builder.worker_threads(threads);
}
}

let rt = {
runtime::Builder::new_multi_thread()
.enable_all()
.thread_name("vector-worker")
.build()
.expect("Unable to create async runtime")
};
let rt = rt_builder.build().expect("Unable to create async runtime");

let config = {
let config_paths = root_opts.config_paths_with_formats();
Expand Down

0 comments on commit 74c3f06

Please sign in to comment.