mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-11 06:27:51 +00:00
fix: lazy computation in thread default
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
This commit is contained in:
parent
e96c1d4b0f
commit
806e983aa5
@ -760,7 +760,7 @@ impl TryFrom<&IndexerOpts> for IndexerConfig {
|
||||
|
||||
fn try_from(other: &IndexerOpts) -> Result<Self, Self::Error> {
|
||||
// use 1/2 cpu threads if no value specified
|
||||
let max_indexing_threads = other.max_indexing_threads.unwrap_or(num_cpus::get() / 2);
|
||||
let max_indexing_threads = other.max_indexing_threads.unwrap_or_else(|| num_cpus::get() / 2);
|
||||
|
||||
let thread_pool = ThreadPoolNoAbortBuilder::new()
|
||||
.thread_name(|index| format!("indexing-thread:{index}"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user