Fix memory registry race

This commit is contained in:
Milos Gajdos 2019-12-03 14:49:24 +00:00
parent bb1a1358b7
commit 265233517e
No known key found for this signature in database
GPG Key ID: 8B31058CC55DFD4F

View File

@ -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)
}