diff options
author | 2016-04-14 21:22:12 +0100 | |
---|---|---|
committer | 2016-04-14 21:22:12 +0100 | |
commit | fb3286983b4e69f05822a8cb4882be4c00bd71b3 (patch) | |
tree | ab6cdecd08306241bf93d9890d2ac8fc799bb723 /core/setup/file.go | |
parent | 885e6e824642de79e80e8b5e97ea320b6f582d6d (diff) | |
download | coredns-fb3286983b4e69f05822a8cb4882be4c00bd71b3.tar.gz coredns-fb3286983b4e69f05822a8cb4882be4c00bd71b3.tar.zst coredns-fb3286983b4e69f05822a8cb4882be4c00bd71b3.zip |
Do the notifies only once during startup
Diffstat (limited to 'core/setup/file.go')
-rw-r--r-- | core/setup/file.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/setup/file.go b/core/setup/file.go index f957c230f..768fec49f 100644 --- a/core/setup/file.go +++ b/core/setup/file.go @@ -20,8 +20,11 @@ func File(c *Controller) (middleware.Middleware, error) { for _, n := range zones.Names { if len(zones.Z[n].TransferTo) > 0 { c.Startup = append(c.Startup, func() error { - zones.Z[n].Notify() - return err + zones.Z[n].StartupOnce.Do(func() { + if len(zones.Z[n].TransferTo) > 0 { + zones.Z[n].Notify() + } + }) }) } } |