Get rids of the unecessary tasks when an index_uid is specified

This commit is contained in:
Irevoire 2022-10-27 18:00:04 +02:00
parent d16ea755d8
commit 01687c87a2
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
2 changed files with 23 additions and 3 deletions

View file

@ -381,6 +381,24 @@ pub enum Kind {
SnapshotCreation,
}
impl Kind {
pub fn related_to_one_index(&self) -> bool {
match self {
Kind::DocumentAdditionOrUpdate
| Kind::DocumentDeletion
| Kind::SettingsUpdate
| Kind::IndexCreation
| Kind::IndexDeletion
| Kind::IndexUpdate => true,
Kind::IndexSwap
| Kind::TaskCancelation
| Kind::TaskDeletion
| Kind::DumpCreation
| Kind::SnapshotCreation => false,
}
}
}
impl FromStr for Kind {
type Err = ResponseError;