Fix number of deleted tasks details after duplicate task deletion

This commit is contained in:
Loïc Lecrenier 2022-10-17 12:58:20 +02:00 committed by Clément Renault
parent d49d7e9c2d
commit 7ce336306d
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 20 additions and 21 deletions

View file

@ -8,6 +8,18 @@ use crate::{Error, IndexScheduler, Result, Task, TaskId};
use meilisearch_types::tasks::{Kind, Status};
impl IndexScheduler {
pub(crate) fn all_task_ids(&self, rtxn: &RoTxn) -> Result<RoaringBitmap> {
let mut all_tasks = RoaringBitmap::new();
for status in [
Status::Enqueued,
Status::Processing,
Status::Succeeded,
Status::Failed,
] {
all_tasks |= self.get_status(&rtxn, status)?;
}
Ok(all_tasks)
}
pub(crate) fn last_task_id(&self, rtxn: &RoTxn) -> Result<Option<TaskId>> {
Ok(self
.all_tasks