mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 18:23:25 -05:00
Do the notifies only once during startup
This commit is contained in:
@@ -20,8 +20,11 @@ func File(c *Controller) (middleware.Middleware, error) {
|
|||||||
for _, n := range zones.Names {
|
for _, n := range zones.Names {
|
||||||
if len(zones.Z[n].TransferTo) > 0 {
|
if len(zones.Z[n].TransferTo) > 0 {
|
||||||
c.Startup = append(c.Startup, func() error {
|
c.Startup = append(c.Startup, func() error {
|
||||||
|
zones.Z[n].StartupOnce.Do(func() {
|
||||||
|
if len(zones.Z[n].TransferTo) > 0 {
|
||||||
zones.Z[n].Notify()
|
zones.Z[n].Notify()
|
||||||
return err
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user