Skip to content

Commit

Permalink
Lift the threads limit
Browse files Browse the repository at this point in the history
After switching to tokio-compat, the thread limit should not
be required.

Signed-off-by: MOZGIII <[email protected]>
  • Loading branch information
MOZGIII committed Mar 26, 2020
1 parent fc19c12 commit 6305861
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extern crate tracing;

use futures01::{future, Future, Stream};
use std::{
cmp::{max, min},
cmp::max,
fs::File,
net::SocketAddr,
path::{Path, PathBuf},
Expand Down Expand Up @@ -227,8 +227,8 @@ fn main() {
info!("Log level {:?} is enabled.", level);

if let Some(threads) = opts.threads {
if threads < 1 || threads > 4 {
error!("The `threads` argument must be between 1 and 4 (inclusive).");
if threads < 1 {
error!("The `threads` argument must be greater or equal to 1.");
std::process::exit(exitcode::CONFIG);
}
}
Expand Down Expand Up @@ -267,8 +267,7 @@ fn main() {

let mut rt = {
let threads = opts.threads.unwrap_or(max(1, num_cpus::get()));
let num_threads = min(4, threads);
runtime::Runtime::with_thread_count(num_threads).expect("Unable to create async runtime")
runtime::Runtime::with_thread_count(threads).expect("Unable to create async runtime")
};

let (metrics_trigger, metrics_tripwire) = stream_cancel::Tripwire::new();
Expand Down

0 comments on commit 6305861

Please sign in to comment.