Skip to content

Commit

Permalink
add missing ttl in pushhover
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 24, 2023
1 parent 6fe1a24 commit 537ffa2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ type PushoverConfig struct {
Priority string `yaml:"priority,omitempty" json:"priority,omitempty"`
Retry duration `yaml:"retry,omitempty" json:"retry,omitempty"`
Expire duration `yaml:"expire,omitempty" json:"expire,omitempty"`
TTL duration `yaml:"ttl,omitempty" json:"ttl,omitempty"`
HTML bool `yaml:"html" json:"html,omitempty"`
}

Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,9 @@ token_file: <filepath>
# acknowledges the notification.
[ expire: <duration> | default = 1h ]
# Optional time to live (ttl) to use for notification, see https://pushover.net/api#ttl
[ ttl: <duration> ]
# The HTTP client's configuration.
[ http_config: <http_config> | default = global.http_config ]
```
Expand Down
1 change: 1 addition & 0 deletions notify/pushover/pushover.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ 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())))
if err != nil {
return false, err
}
Expand Down

0 comments on commit 537ffa2

Please sign in to comment.