Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/omotes_sdk/internal/worker/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
logger = logging.getLogger("omotes_sdk_internal")


class EarlySystemExit(Exception):
"""Wrapper for `SystemExit` exception.

To ensure that the worker process does not shutdown but rather handles the `SystemExit` as an
error
"""

...


class TaskUtil:
"""Utilities for a Celery task."""

Expand Down Expand Up @@ -217,10 +207,7 @@ def wrapped_worker_task(
logger.info("Worker started new task %s", job_id)
task_util = TaskUtil(job_id, task, task.broker_if)
task_util.update_progress(0, "Job calculation started")
try:
task.output_esdl = WORKER_TASK_FUNCTION(input_esdl, params_dict, task_util.update_progress)
except SystemExit as e:
raise EarlySystemExit(e)
task.output_esdl = WORKER_TASK_FUNCTION(input_esdl, params_dict, task_util.update_progress)

task_util.update_progress(1.0, "Calculation finished.")

Expand Down