From 5d57a970ff265331c3812d5a75bf493649d4e459 Mon Sep 17 00:00:00 2001 From: zfrendo <842557664@qq.com> Date: Fri, 17 Jan 2025 11:25:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20tendbHa=E5=AE=9A=E7=82=B9=E5=9B=9E?= =?UTF-8?q?=E6=A1=A3=E5=A2=9E=E5=8A=A0slave=E5=BB=B6=E8=BF=9F=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=20#9096?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/collections/mysql/mysql_check_slave_delay.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_check_slave_delay.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_check_slave_delay.py index 78928d1308..77e861dd86 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_check_slave_delay.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_check_slave_delay.py @@ -48,10 +48,13 @@ def _execute(self, data, parent_data) -> bool: return False else: slave_info = res[0]["cmd_results"][0]["table_data"][0] + slave_delay = 0 + if slave_info["Seconds_Behind_Master"] is not None: + slave_delay = int(slave_info["Seconds_Behind_Master"]) if ( slave_info["Slave_IO_Running"] == "Yes" and slave_info["Slave_SQL_Running"] == "Yes" - and int(slave_info["Seconds_Behind_Master"]) <= 300 + and slave_delay <= 300 ): return True else: