Add error handling to notify
This commit is contained in:
8
main.go
8
main.go
@@ -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)
|
||||||
|
Reference in New Issue
Block a user