mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
feat(stream watchers) fix locking issue
This commit is contained in:
parent
5b924dfd4e
commit
8597904bc2
@ -87,16 +87,6 @@ func (wh *watcherHub) watch(key string, recursive, stream bool, index uint64) (*
|
||||
if l.Len() == 0 {
|
||||
delete(wh.watchers, key)
|
||||
}
|
||||
|
||||
// consume all items in the channel
|
||||
// unblock all the waiting go routines created by watchHub
|
||||
for {
|
||||
select {
|
||||
case <-w.EventChan:
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
atomic.AddInt64(&wh.count, 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user