Skip to content

Commit

Permalink
fix ttl
Browse files Browse the repository at this point in the history
Signed-off-by: Hélia Barroso <[email protected]>
  • Loading branch information
Hélia Barroso committed Aug 30, 2023
1 parent a62fbf8 commit 3803b83
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion notify/pushover/pushover.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error)
parameters.Add("expire", fmt.Sprintf("%d", int64(time.Duration(n.conf.Expire).Seconds())))
parameters.Add("device", tmpl(n.conf.Device))
parameters.Add("sound", tmpl(n.conf.Sound))
parameters.Add("ttl", fmt.Sprintf("%d", int64(time.Duration(n.conf.TTL).Seconds())))

newttl := int64(time.Duration(n.conf.TTL).Seconds())

if newttl > 0 {
parameters.Add("ttl", fmt.Sprintf("%d", newttl))

}

if err != nil {
return false, err
}
Expand Down

0 comments on commit 3803b83

Please sign in to comment.