mvcc: remove defer in watchable store
parent
54536af135
commit
aa85cf037f
|
@ -211,17 +211,15 @@ func (s *watchableStore) watch(key, end []byte, startRev int64, id WatchID, ch c
|
||||||
|
|
||||||
cancel := cancelFunc(func() {
|
cancel := cancelFunc(func() {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
|
||||||
// remove references of the watcher
|
// remove references of the watcher
|
||||||
if s.unsynced.delete(wa) {
|
if s.unsynced.delete(wa) {
|
||||||
slowWatcherGauge.Dec()
|
slowWatcherGauge.Dec()
|
||||||
watcherGauge.Dec()
|
watcherGauge.Dec()
|
||||||
return
|
} else if s.synced.delete(wa) {
|
||||||
}
|
|
||||||
|
|
||||||
if s.synced.delete(wa) {
|
|
||||||
watcherGauge.Dec()
|
watcherGauge.Dec()
|
||||||
}
|
}
|
||||||
|
s.mu.Unlock()
|
||||||
|
|
||||||
// If we cannot find it, it should have finished watch.
|
// If we cannot find it, it should have finished watch.
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue