multi mode: Simplify code

Just like it's done in the single mode.
This commit is contained in:
Thorben Günther 2023-02-21 14:02:19 +01:00
parent cd848543b3
commit d7fdd85b72
No known key found for this signature in database
GPG key ID: 415CD778D8C5AFED

View file

@ -183,7 +183,6 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
} }
n.body = body n.body = body
var priority string
var tags []string var tags []string
if p.Status == "resolved" { if p.Status == "resolved" {
tags = append(tags, br.cfg.resolved.Tags...) tags = append(tags, br.cfg.resolved.Tags...)
@ -201,8 +200,8 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
continue continue
} }
if priority == "" { if n.priority == "" {
priority = labelConfig.Priority n.priority = labelConfig.Priority
} }
if n.icon == "" { if n.icon == "" {
@ -216,9 +215,7 @@ func (br *bridge) multiAlertNotification(p *payload) *notification {
} }
} }
tagString := strings.Join(tags, ",") n.tags = strings.Join(tags, ",")
n.priority = priority
n.tags = tagString
if br.cfg.am.SilenceDuration != 0 && p.Status == "firing" { if br.cfg.am.SilenceDuration != 0 && p.Status == "firing" {
if br.cfg.BaseURL == "" { if br.cfg.BaseURL == "" {