Don't apply multiplier twice

This commit is contained in:
Daniel 2024-11-03 19:20:34 -05:00
parent 28ee194297
commit 092b925a25

View file

@ -179,7 +179,6 @@ func (as *alerter) eval(ctx context.Context, now time.Time, testMode bool) ([]Al
if s.Score > as.cfg.AlertThreshold || testMode { if s.Score > as.cfg.AlertThreshold || testMode {
if old, inCache := as.alertCache[s.ID]; !inCache || now.Sub(old.Timestamp) > as.renotify { if old, inCache := as.alertCache[s.ID]; !inCache || now.Sub(old.Timestamp) > as.renotify {
s.Score *= as.tgCache.ApplyAlertRules(s.ID, now)
a, err := as.makeAlert(ctx, s, origScore) a, err := as.makeAlert(ctx, s, origScore)
if err != nil { if err != nil {
return nil, fmt.Errorf("makeAlert: %w", err) return nil, fmt.Errorf("makeAlert: %w", err)