From 6460b78e089d7f02389c4f6a55d7730fdca9e612 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 19 Oct 2022 11:33:05 +0200 Subject: [PATCH] Clean up the delete_persisted_task_data function --- index-scheduler/src/lib.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index dd7cc1c44..b5db7a836 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -699,21 +699,9 @@ impl IndexScheduler { } pub(crate) fn delete_persisted_task_data(&self, task: &Task) -> Result<()> { - match &task.kind { - KindWithContent::DocumentImport { content_file, .. } => { - self.delete_update_file(*content_file) - } - KindWithContent::DocumentDeletion { .. } - | KindWithContent::DocumentClear { .. } - | KindWithContent::Settings { .. } - | KindWithContent::IndexDeletion { .. } - | KindWithContent::IndexCreation { .. } - | KindWithContent::IndexUpdate { .. } - | KindWithContent::IndexSwap { .. } - | KindWithContent::TaskCancelation { .. } - | KindWithContent::TaskDeletion { .. } - | KindWithContent::DumpExport { .. } - | KindWithContent::Snapshot => Ok(()), + match task.content_uuid() { + Some(content_file) => self.delete_update_file(*content_file), + None => Ok(()), } } }