Commit fb328698 authored by Miek Gieben's avatar Miek Gieben

Do the notifies only once during startup

parent 885e6e82
...@@ -20,8 +20,11 @@ func File(c *Controller) (middleware.Middleware, error) { ...@@ -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].Notify() zones.Z[n].StartupOnce.Do(func() {
return err if len(zones.Z[n].TransferTo) > 0 {
zones.Z[n].Notify()
}
})
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment