From 0994f7c8f8e5414ee061c9e9176fa6542f243690 Mon Sep 17 00:00:00 2001 From: DonHaul Date: Fri, 9 Aug 2024 15:52:28 +0200 Subject: [PATCH] restart actions: delete all dags of workflow before restart * ref: cern-sis/issues-inspire/issues/526 --- backoffice/backoffice/workflows/airflow_utils.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backoffice/backoffice/workflows/airflow_utils.py b/backoffice/backoffice/workflows/airflow_utils.py index 5806a5e5..a37931df 100644 --- a/backoffice/backoffice/workflows/airflow_utils.py +++ b/backoffice/backoffice/workflows/airflow_utils.py @@ -165,10 +165,6 @@ def restart_workflow_dags(workflow_id, workflow_type, params=None): for dag_id in executed_dags_for_workflow: delete_workflow_dag(dag_id, str(workflow_id)) - return trigger_airflow_dag( - WORKFLOW_DAGS[workflow_type].initialize, str(workflow_id), params - ) - - return JsonResponse( - {"error": "Failed to restart"}, status=status.HTTP_424_FAILED_DEPENDENCY + return trigger_airflow_dag( + WORKFLOW_DAGS[workflow_type].initialize, str(workflow_id), params )