mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-10 21:52:01 +02:00
Fix memory registry race
This commit is contained in:
@@ -87,9 +87,8 @@ func (m *Registry) ttlPrune() {
|
||||
}
|
||||
|
||||
func (m *Registry) sendEvent(r *registry.Result) {
|
||||
watchers := make([]*Watcher, 0, len(m.watchers))
|
||||
|
||||
m.RLock()
|
||||
watchers := make([]*Watcher, 0, len(m.watchers))
|
||||
for _, w := range m.watchers {
|
||||
watchers = append(watchers, w)
|
||||
}
|
||||
|
Reference in New Issue
Block a user