From d21651c968799d03eda7b95d9d35a119fae12464 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 19 Oct 2022 11:31:08 +0200 Subject: [PATCH] Throw the error if we can't register the tasks in the store --- index-scheduler/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 5b443fb62..dd7cc1c44 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -438,12 +438,9 @@ impl IndexScheduler { (bitmap.insert(task.uid)); })?; - match wtxn.commit() { - Ok(()) => (), - _e @ Err(_) => { - self.delete_persisted_task_data(&task)?; - // _e?; - } + if let Err(e) = wtxn.commit() { + self.delete_persisted_task_data(&task)?; + return Err(e.into()); } // If the registered task is a task cancelation