1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-02-15 13:53:35 +02:00

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

Co-authored-by: 刘易 <liuyi08@bilibili.com>
This commit is contained in:
liuyi0618 2022-07-04 14:44:38 +08:00 committed by GitHub
parent 9015ffb920
commit 52031f1381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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