Introduce the task cancelation task type

This commit is contained in:
Kerollmops 2022-10-17 17:19:17 +02:00 committed by Clément Renault
parent 4a7b5c7836
commit bcb7d1744a
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 131 additions and 41 deletions

View file

@ -22,7 +22,7 @@ enum AutobatchKind {
IndexDeletion,
IndexUpdate,
IndexSwap,
CancelTask,
TaskCancelation,
TaskDeletion,
DumpExport,
Snapshot,
@ -62,7 +62,7 @@ impl From<KindWithContent> for AutobatchKind {
KindWithContent::IndexCreation { .. } => AutobatchKind::IndexCreation,
KindWithContent::IndexUpdate { .. } => AutobatchKind::IndexUpdate,
KindWithContent::IndexSwap { .. } => AutobatchKind::IndexSwap,
KindWithContent::CancelTask { .. } => AutobatchKind::CancelTask,
KindWithContent::TaskCancelation { .. } => AutobatchKind::TaskCancelation,
KindWithContent::TaskDeletion { .. } => AutobatchKind::TaskDeletion,
KindWithContent::DumpExport { .. } => AutobatchKind::DumpExport,
KindWithContent::Snapshot => AutobatchKind::Snapshot,
@ -153,7 +153,7 @@ impl BatchKind {
allow_index_creation,
settings_ids: vec![task_id],
}),
K::DumpExport | K::Snapshot | K::CancelTask | K::TaskDeletion => {
K::DumpExport | K::Snapshot | K::TaskCancelation | K::TaskDeletion => {
unreachable!()
}
}
@ -378,7 +378,7 @@ impl BatchKind {
import_ids,
})
}
(_, K::CancelTask | K::TaskDeletion | K::DumpExport | K::Snapshot) => {
(_, K::TaskCancelation | K::TaskDeletion | K::DumpExport | K::Snapshot) => {
unreachable!()
}
(