mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Use the new rayon-par-bridge library
This commit is contained in:
parent
b67d385cf0
commit
81ec0abad1
3 changed files with 14 additions and 8 deletions
|
@ -44,7 +44,7 @@ use crate::update::{
|
|||
IndexerConfig, UpdateIndexingStep, WordPrefixDocids, WordPrefixIntegerDocids, WordsPrefixesFst,
|
||||
};
|
||||
use crate::vector::EmbeddingConfigs;
|
||||
use crate::{CboRoaringBitmapCodec, FieldsIdsMap, Index, Object, Result};
|
||||
use crate::{CboRoaringBitmapCodec, Index, Object, Result};
|
||||
|
||||
static MERGED_DATABASE_COUNT: usize = 7;
|
||||
static PREFIX_DATABASE_COUNT: usize = 4;
|
||||
|
@ -262,11 +262,8 @@ where
|
|||
Ok(DocumentEdition::Nothing) as Result<_>
|
||||
});
|
||||
|
||||
std::thread::scope(|s| {
|
||||
let (send, recv) = std::sync::mpsc::sync_channel(100);
|
||||
s.spawn(move || processing.for_each(|el| drop(send.send(el))));
|
||||
|
||||
for result in recv {
|
||||
rayon_par_bridge::par_bridge(100, processing, |iterator| {
|
||||
for result in iterator {
|
||||
if (self.should_abort)() {
|
||||
return Err(Error::InternalError(InternalError::AbortedIndexation));
|
||||
}
|
||||
|
@ -285,8 +282,6 @@ where
|
|||
Ok(())
|
||||
})?;
|
||||
|
||||
drop(immutable_obkvs);
|
||||
|
||||
let file = documents_batch_builder.into_inner()?;
|
||||
let reader = DocumentsBatchReader::from_reader(file)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue