mirror of
https://github.com/go-micro/go-micro.git
synced 2024-11-24 08:02:32 +02:00
make a copy of services for handle method
This commit is contained in:
parent
0afaaeec8d
commit
71d64f911f
@ -201,7 +201,11 @@ func (cw *consulWatcher) handle(idx uint64, data interface{}) {
|
||||
}
|
||||
|
||||
cw.RLock()
|
||||
rservices := cw.services
|
||||
// make a copy
|
||||
rservices := make(map[string][]*Service)
|
||||
for k, v := range cw.services {
|
||||
rservices[k] = v
|
||||
}
|
||||
cw.RUnlock()
|
||||
|
||||
// remove unknown services from registry
|
||||
|
Loading…
Reference in New Issue
Block a user