mirror of
				https://github.com/meilisearch/meilisearch.git
				synced 2025-11-03 17:36:29 +00:00 
			
		
		
		
	fixes
This commit is contained in:
		@@ -156,6 +156,7 @@ impl FacetedDocidsExtractor {
 | 
			
		||||
        res
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[allow(clippy::too_many_arguments)]
 | 
			
		||||
    fn facet_fn_with_options<'extractor, 'doc>(
 | 
			
		||||
        doc_alloc: &'doc Bump,
 | 
			
		||||
        cached_sorter: &mut BalancedCaches<'extractor>,
 | 
			
		||||
@@ -336,6 +337,7 @@ fn truncate_str(s: &str) -> &str {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl FacetedDocidsExtractor {
 | 
			
		||||
    #[allow(clippy::too_many_arguments)]
 | 
			
		||||
    #[tracing::instrument(level = "trace", skip_all, target = "indexing::extract::faceted")]
 | 
			
		||||
    pub fn run_extraction<
 | 
			
		||||
        'pl,
 | 
			
		||||
 
 | 
			
		||||
@@ -106,6 +106,7 @@ impl<'pl> DocumentOperation<'pl> {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#[allow(clippy::too_many_arguments)]
 | 
			
		||||
fn extract_addition_payload_changes<'r, 'pl: 'r>(
 | 
			
		||||
    indexer: &'pl Bump,
 | 
			
		||||
    index: &Index,
 | 
			
		||||
 
 | 
			
		||||
@@ -1,37 +1,16 @@
 | 
			
		||||
use std::cell::{Ref, RefCell, RefMut};
 | 
			
		||||
use std::cell::{RefCell, RefMut};
 | 
			
		||||
 | 
			
		||||
pub trait RefCellExt<T: ?Sized> {
 | 
			
		||||
    fn try_borrow_or_yield(&self) -> std::result::Result<Ref<'_, T>, std::cell::BorrowError>;
 | 
			
		||||
    fn try_borrow_mut_or_yield(
 | 
			
		||||
        &self,
 | 
			
		||||
    ) -> std::result::Result<RefMut<'_, T>, std::cell::BorrowMutError>;
 | 
			
		||||
 | 
			
		||||
    fn borrow_or_yield(&self) -> Ref<'_, T> {
 | 
			
		||||
        self.try_borrow_or_yield().unwrap()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn borrow_mut_or_yield(&self) -> RefMut<'_, T> {
 | 
			
		||||
        self.try_borrow_mut_or_yield().unwrap()
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
impl<T: ?Sized> RefCellExt<T> for RefCell<T> {
 | 
			
		||||
    fn try_borrow_or_yield(&self) -> std::result::Result<Ref<'_, T>, std::cell::BorrowError> {
 | 
			
		||||
        /// TODO: move this trait and impl elsewhere
 | 
			
		||||
        loop {
 | 
			
		||||
            match self.try_borrow() {
 | 
			
		||||
                Ok(borrow) => break Ok(borrow),
 | 
			
		||||
                Err(error) => {
 | 
			
		||||
                    tracing::warn!("dynamic borrow failed, yielding to local tasks");
 | 
			
		||||
                    match rayon::yield_local() {
 | 
			
		||||
                        Some(rayon::Yield::Executed) => continue,
 | 
			
		||||
                        _ => return Err(error),
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    fn try_borrow_mut_or_yield(
 | 
			
		||||
        &self,
 | 
			
		||||
    ) -> std::result::Result<RefMut<'_, T>, std::cell::BorrowMutError> {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user