From cb0c3a5aad0f3fa2ffcfe51a5a59480f8d3049ee Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 4 Dec 2024 15:43:05 +0100 Subject: [PATCH] stop adding one enqueued tasks to all unprioritized batches --- crates/index-scheduler/src/batch.rs | 3 +-- crates/index-scheduler/src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/index-scheduler/src/batch.rs b/crates/index-scheduler/src/batch.rs index ce86c10ca..fc6fb194c 100644 --- a/crates/index-scheduler/src/batch.rs +++ b/crates/index-scheduler/src/batch.rs @@ -496,8 +496,7 @@ impl IndexScheduler { // 5. We make a batch from the unprioritised tasks. Start by taking the next enqueued task. let task_id = if let Some(task_id) = enqueued.min() { task_id } else { return Ok(None) }; - let mut task = self.get_task(rtxn, task_id)?.ok_or(Error::CorruptedTaskQueue)?; - current_batch.processing(Some(&mut task)); + let task = self.get_task(rtxn, task_id)?.ok_or(Error::CorruptedTaskQueue)?; // If the task is not associated with any index, verify that it is an index swap and // create the batch directly. Otherwise, get the index name associated with the task diff --git a/crates/index-scheduler/src/lib.rs b/crates/index-scheduler/src/lib.rs index 2d953fc6e..9715e9e2f 100644 --- a/crates/index-scheduler/src/lib.rs +++ b/crates/index-scheduler/src/lib.rs @@ -4333,15 +4333,15 @@ mod tests { "primaryKey": "mouse" }, "stats": { - "totalNbTasks": 2, + "totalNbTasks": 1, "status": { - "processing": 2 + "processing": 1 }, "types": { - "indexCreation": 2 + "indexCreation": 1 }, "indexUids": { - "catto": 2 + "catto": 1 } }, "startedAt": "1970-01-01T00:00:00Z",