mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01:00
Do not delete all tasks when no canceled-by matches
This commit is contained in:
parent
d3c796af38
commit
e89973f1bf
@ -502,13 +502,22 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let Some(canceled_by) = &query.canceled_by {
|
if let Some(canceled_by) = &query.canceled_by {
|
||||||
|
let mut all_canceled_tasks = RoaringBitmap::new();
|
||||||
for cancel_task_uid in canceled_by {
|
for cancel_task_uid in canceled_by {
|
||||||
if let Some(canceled_by_uid) =
|
if let Some(canceled_by_uid) =
|
||||||
self.canceled_by.get(rtxn, &BEU32::new(*cancel_task_uid))?
|
self.canceled_by.get(rtxn, &BEU32::new(*cancel_task_uid))?
|
||||||
{
|
{
|
||||||
tasks &= canceled_by_uid;
|
all_canceled_tasks |= canceled_by_uid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the canceled_by has been specified but no task
|
||||||
|
// matches then we prefer matching zero than all tasks.
|
||||||
|
if all_canceled_tasks.is_empty() {
|
||||||
|
return Ok(RoaringBitmap::new());
|
||||||
|
} else {
|
||||||
|
tasks &= all_canceled_tasks;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(kind) = &query.types {
|
if let Some(kind) = &query.types {
|
||||||
|
Loading…
Reference in New Issue
Block a user