From 7b3378461db29c7f84148aaf72da86403d938371 Mon Sep 17 00:00:00 2001 From: TariqAHassan Date: Sun, 21 Jul 2024 02:22:16 -0400 Subject: [PATCH 1/2] Fix: Call `post_op` before updating status --- alsek/core/futures.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/alsek/core/futures.py b/alsek/core/futures.py index d4b7294..05e3357 100644 --- a/alsek/core/futures.py +++ b/alsek/core/futures.py @@ -168,6 +168,9 @@ def _wrapper(self) -> None: exception = error self.message.update(exception_details=parse_exception(exception).as_dict()) + # Post op is called here so that exception_details can be set + self.task.post_op(self.message, result=result) + if self._wrapper_exit: log.debug("Thread task future finished after termination.") elif exception is not None: @@ -175,9 +178,6 @@ def _wrapper(self) -> None: else: _complete_future_handler(self.task, self.message, result=result) - # Post op is called here so that exception_details can be set - self.task.post_op(self.message, result=result) - self._wrapper_exit = True def stop(self, exception: Type[BaseException]) -> None: @@ -268,6 +268,9 @@ def _wrapper( exception = error message.update(exception_details=parse_exception(exception).as_dict()) + # Post op is called here so that exception_details can be set + task.post_op(message, result=result) + if not wrapper_exit_queue.empty(): log.debug("Process task future finished after termination.") elif exception is not None: @@ -275,9 +278,6 @@ def _wrapper( else: _complete_future_handler(task, message=message, result=result) - # Post op is called here so that exception_details can be set - task.post_op(message, result=result) - wrapper_exit_queue.put(1) def _shutdown(self) -> None: From d04b0045afaaaf9b39b644255143220ea677ef7f Mon Sep 17 00:00:00 2001 From: TariqAHassan Date: Sun, 21 Jul 2024 02:23:35 -0400 Subject: [PATCH 2/2] Bump version --- alsek/__init__.py | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alsek/__init__.py b/alsek/__init__.py index 2112d11..56edc80 100644 --- a/alsek/__init__.py +++ b/alsek/__init__.py @@ -9,4 +9,4 @@ from alsek.core.status import StatusTracker from alsek.core.task import task -__version__: str = "0.3.0" +__version__: str = "0.3.1" diff --git a/setup.cfg b/setup.cfg index a563aaa..9dafd01 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,4 @@ [metadata] name = alsek -version = 0.3.0 +version = 0.3.1 author = Tariq Hassan