From 5f4409fb8a07f8c273d8fa82adecb667117f3d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20=C5=A0milauer?= Date: Tue, 21 May 2024 10:06:41 +0200 Subject: [PATCH] split monolithic executeWorkflow in blocks (minimal diff) --- mupifDB/workflowscheduler.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mupifDB/workflowscheduler.py b/mupifDB/workflowscheduler.py index 852c6e1..def015f 100644 --- a/mupifDB/workflowscheduler.py +++ b/mupifDB/workflowscheduler.py @@ -321,10 +321,15 @@ def copyLogToDB (we_id, workflowLogName): log.error(repr(e)) -def executeWorkflow(lock, schedulerStat, we_id): +def executeWorkflow(lock, schedulerStat, we_id) -> None: try: log.info("executeWorkflow invoked") + executeWorkflow_inner(lock, schedulerStat, we_id) + except Exception as e: + log.error("Execution of workflow %s failed." % we_id) + log.error(repr(e)) +def executeWorkflow_inner(lock, schedulerStat, we_id) -> None: we_rec = restApiControl.getExecutionRecord(we_id) if we_rec is None: log.error("Workflow Execution record %s not found" % we_id) @@ -470,10 +475,6 @@ def executeWorkflow(lock, schedulerStat, we_id): else: log.error("WEID %s not scheduled for execution" % we_id) raise KeyError("WEID %s not scheduled for execution" % we_id) - except Exception as e: - log.error("Execution of workflow %s failed." % we_id) - log.error(repr(e)) - def stop(var_pool): try: