Browse Source

Merge pull request #3811 from gyuho/storage_watchergauge_fix

storage: move watcherGauge to watchable_store
Xiang Li 10 years ago
parent
commit
03951495d3
2 changed files with 1 additions and 1 deletions
  1. 1 0
      storage/watchable_store.go
  2. 0 1
      storage/watcher.go

+ 1 - 0
storage/watchable_store.go

@@ -165,6 +165,7 @@ func (s *watchableStore) Close() error {
 }
 
 func (s *watchableStore) NewWatcher() Watcher {
+	watcherGauge.Inc()
 	return &watcher{
 		watchable: s,
 		ch:        make(chan storagepb.Event, chanBufLen),

+ 0 - 1
storage/watcher.go

@@ -56,7 +56,6 @@ func (ws *watcher) Watch(key []byte, prefix bool, startRev int64) CancelFunc {
 	}
 	// TODO: cancelFunc needs to be removed from the cancels when it is called.
 	ws.cancels = append(ws.cancels, c)
-	watcherGauge.Inc()
 	return c
 }