Skip to content

Commit

Permalink
fix(backend): 重建从库未触发信号问题 TencentBlueKing#6650
Browse files Browse the repository at this point in the history
  • Loading branch information
ygcyao committed Sep 3, 2024
1 parent 0765695 commit 5e6ad4e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,16 @@ def rebuild_local_slave_state(self):
"""
原地重建后,实例状态保持running状态
"""
StorageInstance.objects.filter(
instances = StorageInstance.objects.filter(
machine__ip=self.global_data["slave_host"]["ip"],
machine__bk_cloud_id=self.global_data["slave_host"]["bk_cloud_id"],
port=self.global_data["port"],
).update(status=InstanceStatus.RUNNING)
)

# 更新状态并保存 触发信号机制
for instance in instances:
instance.status = InstanceStatus.RUNNING
instance.save()

def rebuild_in_new_slave(self):
"""
Expand Down

0 comments on commit 5e6ad4e

Please sign in to comment.