mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Finish first draft of the DELETE /tasks route
This commit is contained in:
parent
ef3e9e87f5
commit
012c3e986c
5 changed files with 81 additions and 53 deletions
|
@ -20,6 +20,7 @@ use meilisearch_types::{
|
|||
use roaring::RoaringBitmap;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum Batch {
|
||||
Cancel(Task),
|
||||
TaskDeletion(Task),
|
||||
|
@ -42,6 +43,7 @@ pub(crate) enum Batch {
|
|||
},
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum IndexOperation {
|
||||
DocumentImport {
|
||||
index_uid: String,
|
||||
|
@ -381,7 +383,7 @@ impl IndexScheduler {
|
|||
}
|
||||
|
||||
// 2. we get the next task to delete
|
||||
let to_delete = self.get_kind(rtxn, Kind::TaskDeletion)?;
|
||||
let to_delete = self.get_kind(rtxn, Kind::TaskDeletion)? & enqueued;
|
||||
if let Some(task_id) = to_delete.min() {
|
||||
let task = self
|
||||
.get_task(rtxn, task_id)?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue