Do the notifies only once during startup
This commit is contained in:
parent
885e6e8246
commit
fb3286983b
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue