plugin/secondary: Fix startup transfer failure wrong zone logged (#5085)

* avoid race

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver
2022-02-14 12:12:08 -05:00
committed by GitHub
parent 80195c399f
commit e5626a77bb

View File

@@ -23,7 +23,8 @@ func setup(c *caddy.Controller) error {
}
// Add startup functions to retrieve the zone and keep it up to date.
for _, n := range zones.Names {
for i := range zones.Names {
n := zones.Names[i]
z := zones.Z[n]
if len(z.TransferFrom) > 0 {
c.OnStartup(func() error {