diff --git a/controller/registries/consul/config.go b/controller/registries/consul/config.go index 2a18cda3..92093002 100644 --- a/controller/registries/consul/config.go +++ b/controller/registries/consul/config.go @@ -393,6 +393,8 @@ func (reg *Consul) refresh(services map[string][]string) { } } } + reg.lock.Lock() + defer reg.lock.Unlock() prevFetchServices := reg.watchingServices reg.watchingServices = serviceMap