Skip to content

Commit

Permalink
perf: 任务回调添加任务输出数据 TencentBlueKing#7554
Browse files Browse the repository at this point in the history
  • Loading branch information
lTimej committed Sep 18, 2024
1 parent 2e1e3da commit 579af9e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gcloud/taskflow3/domains/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from requests import HTTPError

from gcloud.taskflow3.domains.dispatchers import NodeCommandDispatcher
from gcloud.taskflow3.models import TaskCallBackRecord, TaskFlowRelation
from gcloud.taskflow3.models import TaskCallBackRecord, TaskFlowInstance, TaskFlowRelation
from gcloud.utils.redis_lock import redis_lock

logger = logging.getLogger("root")
Expand Down Expand Up @@ -98,7 +98,10 @@ def _url_callback(self):
url = self.record.url
response = None
try:
response = requests.post(url, data=self.extra_info)
task = TaskFlowInstance.objects.get(id=self.task_id)
data = task.get_task_detail()
self.extra_info["outputs"] = data["outputs"]
response = requests.post(url, json=self.extra_info)
response.raise_for_status()
except HTTPError as e:
message = (
Expand Down

0 comments on commit 579af9e

Please sign in to comment.