fixed clippy error

This commit is contained in:
DustInDark
2022-06-16 19:00:42 +09:00
parent 3bcdc6208f
commit a09768b711
2 changed files with 3 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ use hashbrown;
use hashbrown::HashMap; use hashbrown::HashMap;
use serde_json::Value; use serde_json::Value;
use std::fmt::Write; use std::fmt::Write;
use std::path::PathBuf; use std::path::Path;
use std::sync::Arc; use std::sync::Arc;
use tokio::{runtime::Runtime, spawn, task::JoinHandle}; use tokio::{runtime::Runtime, spawn, task::JoinHandle};

View File

@@ -185,8 +185,9 @@ pub fn get_event_value<'a>(key: &str, event_value: &'a Value) -> Option<&'a Valu
} }
pub fn get_thread_num() -> usize { pub fn get_thread_num() -> usize {
let cpu_num = num_cpus::get();
let conf = configs::CONFIG.read().unwrap(); let conf = configs::CONFIG.read().unwrap();
conf.args.thread_number.unwrap_or_else(num_cpus::get()) conf.args.thread_number.unwrap_or(cpu_num)
} }
pub fn create_tokio_runtime() -> Runtime { pub fn create_tokio_runtime() -> Runtime {