Skip to content

Commit

Permalink
fix: 修复子任务超时后跳过时父任务状态未切换成执行中的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Mar 15, 2024
1 parent c6f264f commit 9664d3a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions gcloud/taskflow3/domains/node_timeout_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@ def deal_with_timeout_node(self, task, node_id):

class ForcedFailStrategy(NodeTimeoutStrategy):
def deal_with_timeout_node(self, task, node_id):
return task.nodes_action("forced_fail", node_id, self.TIMEOUT_NODE_OPERATOR, full_ex_data=self.ex_data_hint,)
return task.nodes_action("forced_fail", node_id, self.TIMEOUT_NODE_OPERATOR, full_ex_data=self.ex_data_hint)


class ForcedFailAndSkipStrategy(NodeTimeoutStrategy):
def deal_with_timeout_node(self, task, node_id):
fail_result = task.nodes_action(
"forced_fail", node_id, self.TIMEOUT_NODE_OPERATOR, full_ex_data=self.ex_data_hint,
"forced_fail", node_id, self.TIMEOUT_NODE_OPERATOR, full_ex_data=self.ex_data_hint
)
if fail_result["result"]:
skip_result = task.nodes_action("skip", node_id, self.TIMEOUT_NODE_OPERATOR)
return skip_result
return fail_result
if not fail_result["result"]:
return fail_result

skip_result = task.nodes_action("skip", node_id, self.TIMEOUT_NODE_OPERATOR)
if skip_result["result"]:
task.change_parent_task_node_state_to_running()
return skip_result


node_timeout_handler = {
Expand Down

0 comments on commit 9664d3a

Please sign in to comment.