Add error handling to notify

This commit is contained in:
2024-08-25 21:49:41 +02:00
parent 3b43378184
commit 77283822fd

View File

@@ -59,7 +59,13 @@ func main() {
if !queued { if !queued {
delay := 5 * time.Minute delay := 5 * time.Minute
log.Printf("Mailing changes in %v seconds", delay.Seconds()) log.Printf("Mailing changes in %v seconds", delay.Seconds())
time.AfterFunc(delay, func() { doNotify() }) time.AfterFunc(delay, func() {
err := doNotify()
if err != nil {
Error.Printf("Error sending mail: %v", err)
return
}
})
queued = true queued = true
} }
changes = append(changes, &event) changes = append(changes, &event)