Apply suggested changes

Co-authored-by: Clément Renault <renault.cle@gmail.com>

Update crates/meilisearch/src/lib.rs

Co-authored-by: Clément Renault <renault.cle@gmail.com>
This commit is contained in:
Nate Nethercott 2025-05-01 14:48:59 +02:00 committed by nnethercott
parent 89aff2081c
commit 2ac826edca
2 changed files with 11 additions and 11 deletions

View File

@ -37,7 +37,7 @@ use index_scheduler::{IndexScheduler, IndexSchedulerOptions};
use meilisearch_auth::{open_auth_store_env, AuthController};
use meilisearch_types::milli::constants::VERSION_MAJOR;
use meilisearch_types::milli::documents::{DocumentsBatchBuilder, DocumentsBatchReader};
use meilisearch_types::milli::update::{IndexDocumentsConfig, IndexDocumentsMethod, IndexerConfig};
use meilisearch_types::milli::update::{IndexDocumentsConfig, IndexDocumentsMethod};
use meilisearch_types::milli::ThreadPoolNoAbortBuilder;
use meilisearch_types::settings::apply_settings_to_builder;
use meilisearch_types::tasks::KindWithContent;
@ -504,7 +504,7 @@ fn import_dump(
let network = dump_reader.network()?.cloned().unwrap_or_default();
index_scheduler.put_network(network)?;
let mut indexer_config = IndexerConfig::clone_no_threadpool(index_scheduler.indexer_config());
let mut indexer_config = index_scheduler.indexer_config().clone_no_threadpool();
// 3.1 Use all cpus to index the import dump
indexer_config.thread_pool = {

View File

@ -26,16 +26,16 @@ impl IndexerConfig {
}
}
pub fn clone_no_threadpool(other: &IndexerConfig) -> Self {
pub fn clone_no_threadpool(&self) -> Self {
Self {
log_every_n: other.log_every_n,
max_nb_chunks: other.max_nb_chunks,
documents_chunk_size: other.documents_chunk_size,
max_memory: other.max_memory,
chunk_compression_type: other.chunk_compression_type,
chunk_compression_level: other.chunk_compression_level,
max_positions_per_attributes: other.max_positions_per_attributes,
skip_index_budget: other.skip_index_budget,
log_every_n: self.log_every_n,
max_nb_chunks: self.max_nb_chunks,
documents_chunk_size: self.documents_chunk_size,
max_memory: self.max_memory,
chunk_compression_type: self.chunk_compression_type,
chunk_compression_level: self.chunk_compression_level,
max_positions_per_attributes: self.max_positions_per_attributes,
skip_index_budget: self.skip_index_budget,
thread_pool: None,
}
}