From fa3a1d515b66ec3667e5d8a96a6f8f17163ecb2e Mon Sep 17 00:00:00 2001 From: jinronga <1460595002@qq.com> Date: Fri, 27 Dec 2024 12:09:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=8E=A2=E6=B5=8B=E7=AD=96=E7=95=A5=E5=91=8A=E8=AD=A6=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/server/houyi/internal/data/repoimpl/strategy.go | 1 + pkg/houyi/datasource/endpoint_port.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/server/houyi/internal/data/repoimpl/strategy.go b/cmd/server/houyi/internal/data/repoimpl/strategy.go index 062a98d19..56f40cbac 100644 --- a/cmd/server/houyi/internal/data/repoimpl/strategy.go +++ b/cmd/server/houyi/internal/data/repoimpl/strategy.go @@ -77,6 +77,7 @@ func (s *strategyRepositoryImpl) resolvedAlerts(ctx context.Context, strategy bo // Eval 评估策略 告警/恢复 func (s *strategyRepositoryImpl) Eval(ctx context.Context, strategy bo.IStrategy) (*bo.Alarm, error) { alarmInfo := strategy.BuilderAlarmBaseInfo() + // 恢复告警 if !strategy.GetStatus().IsEnable() { alerts := s.resolvedAlerts(ctx, strategy) alarmInfo.Alerts = alerts diff --git a/pkg/houyi/datasource/endpoint_port.go b/pkg/houyi/datasource/endpoint_port.go index ade99e2b0..15db47f28 100644 --- a/pkg/houyi/datasource/endpoint_port.go +++ b/pkg/houyi/datasource/endpoint_port.go @@ -23,12 +23,12 @@ func EndpointPortEval(_ context.Context, endpoint string, port uint32, timeout t Labels: labels.Map(), Values: []*Value{ { - Value: 0, + Value: 1, Timestamp: now.Unix(), }, }, } - return points, err + return points, nil } // 连接成功,关闭连接 defer conn.Close() @@ -37,7 +37,7 @@ func EndpointPortEval(_ context.Context, endpoint string, port uint32, timeout t Labels: labels.Map(), Values: []*Value{ { - Value: 1, + Value: 0, Timestamp: now.Unix(), }, },