We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f2c69e commit d70f304Copy full SHA for d70f304
go.mod
@@ -4,6 +4,5 @@ go 1.16
4
5
require (
6
github.com/casbin/casbin/v2 v2.30.2
7
- go.etcd.io/etcd/api/v3 v3.5.0
8
go.etcd.io/etcd/client/v3 v3.5.0
9
)
watcher.go
@@ -164,6 +164,14 @@ func (w *Watcher) Update() error {
164
func (w *Watcher) startWatch() error {
165
watcher := w.client.Watch(context.Background(), w.keyName)
166
for res := range watcher {
167
+ // Skip progress notifications
168
+ if res.IsProgressNotify() {
169
+ continue
170
+ }
171
+ // Skip empty events
172
+ if len(res.Events) == 0 {
173
174
175
t := res.Events[0]
176
if t.IsCreate() || t.IsModify() {
177
w.lock.RLock()
0 commit comments