diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 3e28a200e..39460052e 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -970,11 +970,7 @@ impl IndexScheduler { /// Delete each given task from all the databases (if it is deleteable). /// /// Return the number of tasks that were actually deleted. - fn delete_matched_tasks( - &self, - wtxn: &mut RwTxn, - matched_tasks: &RoaringBitmap, - ) -> Result { + fn delete_matched_tasks(&self, wtxn: &mut RwTxn, matched_tasks: &RoaringBitmap) -> Result { // 1. Remove from this list the tasks that we are not allowed to delete let enqueued_tasks = self.get_status(wtxn, Status::Enqueued)?; let processing_tasks = &self.processing_tasks.read().unwrap().processing.clone(); @@ -1021,7 +1017,7 @@ impl IndexScheduler { self.all_tasks.delete(wtxn, &BEU32::new(task))?; } - Ok(to_delete_tasks.len() as usize) + Ok(to_delete_tasks.len()) } /// Cancel each given task from all the databases (if it is cancelable). @@ -1032,7 +1028,7 @@ impl IndexScheduler { wtxn: &mut RwTxn, cancel_task_id: TaskId, matched_tasks: &RoaringBitmap, - ) -> Result { + ) -> Result { let now = OffsetDateTime::now_utc(); // 1. Remove from this list the tasks that we are not allowed to cancel @@ -1050,6 +1046,6 @@ impl IndexScheduler { self.update_task(wtxn, &task)?; } - Ok(tasks_to_cancel.len() as usize) + Ok(tasks_to_cancel.len()) } } diff --git a/meilisearch-http/src/routes/tasks.rs b/meilisearch-http/src/routes/tasks.rs index e68c83465..2803ac056 100644 --- a/meilisearch-http/src/routes/tasks.rs +++ b/meilisearch-http/src/routes/tasks.rs @@ -109,9 +109,9 @@ pub struct DetailsView { #[serde(skip_serializing_if = "Option::is_none")] pub matched_tasks: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub canceled_tasks: Option>, + pub canceled_tasks: Option>, #[serde(skip_serializing_if = "Option::is_none")] - pub deleted_tasks: Option>, + pub deleted_tasks: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub original_query: Option, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/meilisearch-types/src/tasks.rs b/meilisearch-types/src/tasks.rs index 0dfa4785c..0d262c497 100644 --- a/meilisearch-types/src/tasks.rs +++ b/meilisearch-types/src/tasks.rs @@ -405,12 +405,12 @@ pub enum Details { }, TaskCancelation { matched_tasks: u64, - canceled_tasks: Option, + canceled_tasks: Option, original_query: String, }, TaskDeletion { matched_tasks: u64, - deleted_tasks: Option, + deleted_tasks: Option, original_query: String, }, Dump {