Skip to content

Commit

Permalink
feat: 规则审计-策略新增/编辑-后端接口 --story=121513458
Browse files Browse the repository at this point in the history
【修复】
1. 更新 flow 前先停止 flow
  • Loading branch information
0RAJA committed Jan 23, 2025
1 parent a690a9e commit 5a2bf3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/services/web/analyze/controls/rule_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def _update_or_create_bkbase_flow(self) -> bool:
if need_create:
self._create_flow()
else:
self.disabled()
self.disabled(force=True)
flow_id = self.strategy.backend_data["flow_id"]
data_source_node_ids = self.create_or_update_data_source_nodes(need_create, flow_id)
# 构建 sql 节点
Expand Down Expand Up @@ -533,7 +533,7 @@ def enable(self, force: bool = False) -> None:
else:
self._toggle_strategy(FlowStatusToggleChoices.RESTART.value, force=force)

def disabled(self) -> None:
def disabled(self, force: bool = False) -> None:
flow_status = self._describe_flow_status()
if flow_status in [FlowNodeStatusChoices.RUNNING, FlowNodeStatusChoices.FAILED]:
self._toggle_strategy(FlowStatusToggleChoices.STOP.value)
self._toggle_strategy(FlowStatusToggleChoices.STOP.value, force=force)

0 comments on commit 5a2bf3d

Please sign in to comment.