From 7efb1cae11a89ddd4c2f6b8cf803ec51e980c7e2 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Thu, 8 Feb 2024 18:21:27 +0100 Subject: [PATCH] yield in loop when the channel is not disconnected --- milli/src/update/index_documents/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index 912ff2c2d..de797541d 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -497,6 +497,8 @@ where // If no more chunk remains in the chunk accumulator and the channel is disconected, break. } else if status == crossbeam_channel::RecvTimeoutError::Disconnected { break; + } else { + rayon::yield_now(); } } Ok(result) => {