Fix most of the easy issues

This commit is contained in:
Clément Renault
2025-06-30 18:31:32 +02:00
parent 7219299436
commit 85037352b9
6 changed files with 39 additions and 16 deletions

View File

@ -510,9 +510,9 @@ impl IndexScheduler {
// 3. we batch the export.
let to_export = self.queue.tasks.get_kind(rtxn, Kind::Export)? & enqueued;
if !to_export.is_empty() {
let mut tasks = self.queue.tasks.get_existing_tasks(rtxn, to_export)?;
current_batch.processing(&mut tasks);
let task = tasks.pop().expect("There must be only one export task");
let task_id = to_export.iter().next().expect("There must be only one export task");
let mut task = self.queue.tasks.get_task(rtxn, task_id)?.unwrap();
current_batch.processing([&mut task]);
current_batch.reason(BatchStopReason::TaskKindCannotBeBatched { kind: Kind::Export });
return Ok(Some((Batch::Export { task }, current_batch)));
}