mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
refactor: remove runtime cfg!(test) check
Won't work in integration tests and consequently all threads would be used. To remedy this we make explicit `max_threads=Some(1)` in the IndexerConfig::default
This commit is contained in:
parent
75a7e40a27
commit
15cdc6924b
3 changed files with 12 additions and 33 deletions
|
@ -501,12 +501,11 @@ fn import_dump(
|
|||
let network = dump_reader.network()?.cloned().unwrap_or_default();
|
||||
index_scheduler.put_network(network)?;
|
||||
|
||||
// 3.1 Use all cpus to process dump if a) `max_indexing_threads` not configured and
|
||||
// b) we're not executing from within a test
|
||||
// 3.1 Use all cpus to process dump if `max_indexing_threads` not configured
|
||||
let backup_config;
|
||||
let base_config = index_scheduler.indexer_config();
|
||||
|
||||
let indexer_config = if base_config.max_threads.is_none() && !cfg!(test) {
|
||||
let indexer_config = if base_config.max_threads.is_none() {
|
||||
let thread_pool = ThreadPoolNoAbortBuilder::new()
|
||||
.thread_name(|index| format!("indexing-thread:{index}"))
|
||||
.num_threads(num_cpus::get())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue