From 5e6ad4eef91632314c7541baf3e39b1ef86114c2 Mon Sep 17 00:00:00 2001 From: ycggyao Date: Tue, 3 Sep 2024 21:08:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20=E9=87=8D=E5=BB=BA=E4=BB=8E?= =?UTF-8?q?=E5=BA=93=E6=9C=AA=E8=A7=A6=E5=8F=91=E4=BF=A1=E5=8F=B7=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20#6650?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py index 30b07ef11a..641813af50 100644 --- a/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py +++ b/dbm-ui/backend/flow/utils/sqlserver/sqlserver_db_meta.py @@ -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): """