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()
|
cw.RLock()
|
||||||
rservices := cw.services
|
// make a copy
|
||||||
|
rservices := make(map[string][]*Service)
|
||||||
|
for k, v := range cw.services {
|
||||||
|
rservices[k] = v
|
||||||
|
}
|
||||||
cw.RUnlock()
|
cw.RUnlock()
|
||||||
|
|
||||||
// remove unknown services from registry
|
// remove unknown services from registry
|
||||||
|
Loading…
Reference in New Issue
Block a user