From ef47a0d820610e0dc306cf8a8d2e6b93e70c9798 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 28 Jan 2025 12:07:02 +0100 Subject: [PATCH] apply review comment --- crates/index-scheduler/src/queue/batches.rs | 2 +- crates/index-scheduler/src/scheduler/process_batch.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/index-scheduler/src/queue/batches.rs b/crates/index-scheduler/src/queue/batches.rs index 67c3f71fc..970e41110 100644 --- a/crates/index-scheduler/src/queue/batches.rs +++ b/crates/index-scheduler/src/queue/batches.rs @@ -245,7 +245,7 @@ impl BatchQueue { wtxn, self.enqueued_at, old_batch.started_at, - if old_batch.stats.total_nb_tasks >= 2 { 2 } else { 1 }, + old_batch.stats.total_nb_tasks.clamp(1, 2) as usize, old_batch.uid, )?; } diff --git a/crates/index-scheduler/src/scheduler/process_batch.rs b/crates/index-scheduler/src/scheduler/process_batch.rs index c374044f5..623bdeb53 100644 --- a/crates/index-scheduler/src/scheduler/process_batch.rs +++ b/crates/index-scheduler/src/scheduler/process_batch.rs @@ -538,7 +538,7 @@ impl IndexScheduler { wtxn, self.queue.batches.enqueued_at, batch.started_at, - if batch.stats.total_nb_tasks >= 2 { 2 } else { 1 }, + batch.stats.total_nb_tasks.clamp(1, 2) as usize, batch_id, )?; }