From c6dcc6c9afdffac9de5631bc161704226f726ef2 Mon Sep 17 00:00:00 2001 From: hanshuaikang <1758504262@qq.com> Date: Thu, 7 Sep 2023 17:48:58 +0800 Subject: [PATCH] =?UTF-8?q?minor:=20detail=20=E6=8E=A5=E5=8F=A3=E6=94=AF?= =?UTF-8?q?=E6=8C=81retry=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gcloud/taskflow3/apis/django/api.py | 10 +++++++++- gcloud/taskflow3/domains/dispatchers/node.py | 4 +++- gcloud/taskflow3/models.py | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcloud/taskflow3/apis/django/api.py b/gcloud/taskflow3/apis/django/api.py index cf9bce62e1..457434513e 100644 --- a/gcloud/taskflow3/apis/django/api.py +++ b/gcloud/taskflow3/apis/django/api.py @@ -200,6 +200,7 @@ def detail(request, project_id): task_id = request.query_params["instance_id"] node_id = request.query_params["node_id"] loop = request.query_params.get("loop") + retry = request.query_params.get("retry") == "true" component_code = request.query_params.get("component_code") include_data = int(request.query_params.get("include_data", 1)) @@ -207,7 +208,14 @@ def detail(request, project_id): task = TaskFlowInstance.objects.get(pk=task_id, project_id=project_id) ctx = task.get_node_detail( - node_id, request.user.username, component_code, subprocess_stack, loop, include_data, project_id=project_id + node_id, + request.user.username, + component_code, + subprocess_stack, + loop, + include_data, + project_id=project_id, + retry=retry, ) return JsonResponse(ctx) diff --git a/gcloud/taskflow3/domains/dispatchers/node.py b/gcloud/taskflow3/domains/dispatchers/node.py index 36d591b324..a1d0ea3f69 100644 --- a/gcloud/taskflow3/domains/dispatchers/node.py +++ b/gcloud/taskflow3/domains/dispatchers/node.py @@ -504,7 +504,9 @@ def get_node_data_v2( if node_info["type"] == "SubProcess": # remove prefix '${' and subfix '}' in subprocess execution input inputs = {k[2:-1]: v for k, v in data["inputs"].items()} - elif node_info["type"] == "ServiceActivity" and node_code == "subprocess_plugin": + elif ( + node_info["type"] == "ServiceActivity" and node_code == "subprocess_plugin" and kwargs.get("retry") + ): raw_inputs = data["inputs"]["subprocess"]["pipeline"]["constants"] inputs = {key[2:-1]: value.get("value") for key, value in raw_inputs.items()} else: diff --git a/gcloud/taskflow3/models.py b/gcloud/taskflow3/models.py index 61f11df366..be4ddede4c 100644 --- a/gcloud/taskflow3/models.py +++ b/gcloud/taskflow3/models.py @@ -958,6 +958,7 @@ def get_node_detail( pipeline_instance=self.pipeline_instance, subprocess_stack=subprocess_stack, project_id=kwargs["project_id"], + retry=kwargs.get("retry", False), ) if not node_data_result["result"]: return node_data_result