feat: send to multiple notification channels if they have the same name
This commit is contained in:
parent
5be3a1d4e2
commit
7c2131fe24
1 changed files with 1 additions and 3 deletions
4
main.go
4
main.go
|
|
@ -65,13 +65,11 @@ func executeJob(t time.Time, job jobconfig, c config) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("Error while Execute command")
|
log.Err(err).Msg("Error while Execute command")
|
||||||
}
|
}
|
||||||
nc := notificationConfig{}
|
|
||||||
for _, n := range c.Notification {
|
for _, n := range c.Notification {
|
||||||
if n.Name == job.Notification {
|
if n.Name == job.Notification {
|
||||||
nc = n
|
sendNotification(result, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendNotification(result, nc)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendNotification(result jobResult, notification notificationConfig) error {
|
func sendNotification(result jobResult, notification notificationConfig) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue