mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-11 07:28:56 +01:00
Prefer using an u64 instead of a usize in some places
This commit is contained in:
parent
79c4275bfc
commit
3cbfacb616
@ -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<usize> {
|
||||
fn delete_matched_tasks(&self, wtxn: &mut RwTxn, matched_tasks: &RoaringBitmap) -> Result<u64> {
|
||||
// 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<usize> {
|
||||
) -> Result<u64> {
|
||||
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())
|
||||
}
|
||||
}
|
||||
|
@ -109,9 +109,9 @@ pub struct DetailsView {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub matched_tasks: Option<u64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub canceled_tasks: Option<Option<usize>>,
|
||||
pub canceled_tasks: Option<Option<u64>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub deleted_tasks: Option<Option<usize>>,
|
||||
pub deleted_tasks: Option<Option<u64>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub original_query: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -405,12 +405,12 @@ pub enum Details {
|
||||
},
|
||||
TaskCancelation {
|
||||
matched_tasks: u64,
|
||||
canceled_tasks: Option<usize>,
|
||||
canceled_tasks: Option<u64>,
|
||||
original_query: String,
|
||||
},
|
||||
TaskDeletion {
|
||||
matched_tasks: u64,
|
||||
deleted_tasks: Option<usize>,
|
||||
deleted_tasks: Option<u64>,
|
||||
original_query: String,
|
||||
},
|
||||
Dump {
|
||||
|
Loading…
Reference in New Issue
Block a user