refactor: prefer helper over explicit pool construction

Co-authored-by: Many the fish <many@meilisearch.com>
This commit is contained in:
Nate Nethercott 2025-05-15 11:04:38 +02:00 committed by nnethercott
parent 865f24cfef
commit 79db2e67fb
3 changed files with 7 additions and 7 deletions

View file

@ -30,7 +30,7 @@ impl IndexerConfig {
/// By default use only 1 thread for indexing in tests
#[cfg(test)]
fn default_thread_pool_and_threads() -> (ThreadPoolNoAbort, Option<usize>) {
pub fn default_thread_pool_and_threads() -> (ThreadPoolNoAbort, Option<usize>) {
let pool = ThreadPoolNoAbortBuilder::new_for_indexing()
.num_threads(1)
.build()
@ -40,7 +40,7 @@ fn default_thread_pool_and_threads() -> (ThreadPoolNoAbort, Option<usize>) {
}
#[cfg(not(test))]
fn default_thread_pool_and_threads() -> (ThreadPoolNoAbort, Option<usize>) {
pub fn default_thread_pool_and_threads() -> (ThreadPoolNoAbort, Option<usize>) {
let pool = ThreadPoolNoAbortBuilder::new_for_indexing()
.build()
.expect("failed to build default rayon thread pool");

View file

@ -4,7 +4,7 @@ pub use self::concurrent_available_ids::ConcurrentAvailableIds;
pub use self::facet::bulk::FacetsUpdateBulk;
pub use self::facet::incremental::FacetsUpdateIncrementalInner;
pub use self::index_documents::*;
pub use self::indexer_config::IndexerConfig;
pub use self::indexer_config::{default_thread_pool_and_threads, IndexerConfig};
pub use self::new::ChannelCongestion;
pub use self::settings::{validate_embedding_settings, Setting, Settings};
pub use self::update_step::UpdateIndexingStep;