diff --git a/crates/index-scheduler/src/utils.rs b/crates/index-scheduler/src/utils.rs index 92e5e4b99..1ca782f8c 100644 --- a/crates/index-scheduler/src/utils.rs +++ b/crates/index-scheduler/src/utils.rs @@ -61,9 +61,9 @@ impl ProcessingBatch { /// Update itself with the content of the task and update the batch id in the task. pub fn processing<'a>(&mut self, tasks: impl IntoIterator) { - self.stats.total_nb_tasks += 1; - for task in tasks.into_iter() { + self.stats.total_nb_tasks += 1; + task.batch_uid = Some(self.uid); // We don't store the statuses in the map since they're all enqueued but we must // still store them in the stats since that can be displayed. diff --git a/crates/meilisearch/tests/batches/mod.rs b/crates/meilisearch/tests/batches/mod.rs index 81d254f9f..799aa3df7 100644 --- a/crates/meilisearch/tests/batches/mod.rs +++ b/crates/meilisearch/tests/batches/mod.rs @@ -46,7 +46,12 @@ async fn list_batches() { .await; let (response, code) = index.list_batches().await; assert_eq!(code, 200); - assert_eq!(response["results"].as_array().unwrap().len(), 2); + assert_eq!( + response["results"].as_array().unwrap().len(), + 2, + "{}", + serde_json::to_string_pretty(&response).unwrap() + ); } #[actix_rt::test]