From 700b4549d988e170f35ce573dad0699ffefe850d Mon Sep 17 00:00:00 2001 From: Xujiacheng Date: Fri, 13 Feb 2026 15:06:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=A4=E6=96=AD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=A6=BB=E7=BA=BF=E9=80=BB=E8=BE=91=E4=B8=BA?= =?UTF-8?q?=EF=BC=9A=E8=AE=BF=E9=97=AE=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E8=AF=956=E6=AC=A1=E5=90=8E=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9F=AD=E4=BF=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Models/TimerClass.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Models/TimerClass.cs b/Models/TimerClass.cs index 38dcea7..76f5133 100644 --- a/Models/TimerClass.cs +++ b/Models/TimerClass.cs @@ -20,6 +20,8 @@ namespace AutoNotificatPhone.Models // 消息控制器实例 private readonly CallAndMsgController _callAndMsgController = new(); private readonly IConfiguration _configuration; + // Kafka数据库连接失败累计次数 + private int _kafkaDbConnectionAlertCount = 0; public TimerClass(IConfiguration configuration) { @@ -555,12 +557,20 @@ namespace AutoNotificatPhone.Models /// private void ExecuteKafkaDbConnectionAlert() { + _kafkaDbConnectionAlertCount++; + if (_kafkaDbConnectionAlertCount < 8) + { + return; + } + SendAlert( smsContent: "[BLV运维提示] 数据库连接失败!", callContent: "[BLV运维提示] 数据库连接失败", alertType: "BLS-数据库连接警报", extendedDeadline: true ); + + _kafkaDbConnectionAlertCount = 0; } ///