feat(contrib):add etcd watcher withKeysOnly option (#2146)

Co-authored-by: 刘易 <liuyi08@bilibili.com>
pull/2151/head
liuyi0618 2 years ago committed by GitHub
parent 9015ffb920
commit 52031f1381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      contrib/registry/etcd/watcher.go

@ -29,7 +29,7 @@ func newWatcher(ctx context.Context, key, name string, client *clientv3.Client)
serviceName: name,
}
w.ctx, w.cancel = context.WithCancel(ctx)
w.watchChan = w.watcher.Watch(w.ctx, key, clientv3.WithPrefix(), clientv3.WithRev(0))
w.watchChan = w.watcher.Watch(w.ctx, key, clientv3.WithPrefix(), clientv3.WithRev(0), clientv3.WithKeysOnly())
err := w.watcher.RequestProgress(context.Background())
if err != nil {
return nil, err

Loading…
Cancel
Save