Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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