From edec8472317691f14e5de4ddfd282bac5f293e81 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-repo/backoffice-repo/backoffice/backoffice/workflows/airflow_utils.py b/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/airflow_utils.py index 5806a5e58..a37931df4 100644 --- a/backoffice-repo/backoffice-repo/backoffice/backoffice/workflows/airflow_utils.py +++ b/backoffice-repo/backoffice-repo/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 )