aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/notify.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/file/notify.go')
-rw-r--r--middleware/file/notify.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/middleware/file/notify.go b/middleware/file/notify.go
index bbdafe022..6667fb05d 100644
--- a/middleware/file/notify.go
+++ b/middleware/file/notify.go
@@ -2,6 +2,7 @@ package file
import (
"fmt"
+ "log"
"github.com/miekg/coredns/middleware"
@@ -21,9 +22,12 @@ func notify(zone string, to []string) error {
m.SetNotify(zone)
c := new(dns.Client)
- // TODO(miek): error handling? Run this in a goroutine?
for _, t := range to {
- notifyAddr(c, m, t)
+ if err := notifyAddr(c, m, t); err != nil {
+ log.Printf("[ERROR] " + err.Error())
+ } else {
+ log.Printf("[INFO] Sent notify for zone %s to %s", zone, t)
+ }
}
return nil
}
@@ -34,7 +38,6 @@ func notifyAddr(c *dns.Client, m *dns.Msg, s string) error {
if err == nil && ret.Rcode == dns.RcodeSuccess || ret.Rcode == dns.RcodeNotImplemented {
return nil
}
- // timeout? mean don't want it. should stop sending as well?
}
- return fmt.Errorf("failed to send notify for zone '%s' to '%s'", m.Question[0].Name, s)
+ return fmt.Errorf("Failed to send notify for zone '%s' to '%s'", m.Question[0].Name, s)
}