From 17810394b80ce859b5be78e341ea887bc4f40f44 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 9 Sep 2025 10:48:07 +0200 Subject: [PATCH] fix the quantic progress trace --- crates/index-scheduler/src/queue/batches.rs | 6 +++--- crates/milli/src/progress.rs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/index-scheduler/src/queue/batches.rs b/crates/index-scheduler/src/queue/batches.rs index 2045258df..5d71b4b29 100644 --- a/crates/index-scheduler/src/queue/batches.rs +++ b/crates/index-scheduler/src/queue/batches.rs @@ -275,10 +275,10 @@ impl BatchQueue { pub(crate) fn get_existing_batches( &self, rtxn: &RoTxn, - tasks: impl IntoIterator, + batches: impl IntoIterator, processing: &ProcessingTasks, ) -> Result> { - tasks + batches .into_iter() .map(|batch_id| { if Some(batch_id) == processing.batch.as_ref().map(|batch| batch.uid) { @@ -295,7 +295,7 @@ impl BatchQueue { Ok(batch) } else { self.get_batch(rtxn, batch_id) - .and_then(|task| task.ok_or(Error::CorruptedTaskQueue)) + .and_then(|batch| batch.ok_or(Error::CorruptedTaskQueue)) } }) .collect::>() diff --git a/crates/milli/src/progress.rs b/crates/milli/src/progress.rs index 61c61cd49..6b1c46d11 100644 --- a/crates/milli/src/progress.rs +++ b/crates/milli/src/progress.rs @@ -88,11 +88,12 @@ impl Progress { } pub fn accumulated_durations(&self) -> IndexMap { - let mut inner = self.steps.write().unwrap(); - let InnerProgress { steps, durations, .. } = &mut *inner; + let inner = self.steps.read().unwrap(); + let InnerProgress { steps, durations, .. } = &*inner; + let mut durations = durations.clone(); let now = Instant::now(); - push_steps_durations(steps, durations, now, 0); + push_steps_durations(steps, &mut durations, now, 0); durations.drain(..).map(|(name, duration)| (name, format!("{duration:.2?}"))).collect() }