Skip to content

Commit

Permalink
config filter event type
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 7, 2021
1 parent 9d1eb19 commit c1451d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/config/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/spf13/viper"
"go.etcd.io/etcd/api/v3/mvccpb"
clientv3 "go.etcd.io/etcd/client/v3"
"go.uber.org/zap"

Expand Down Expand Up @@ -53,8 +54,13 @@ func (t *remoteConfig) WatchChannel(rp viper.RemoteProvider) (<-chan *viper.Remo
return
case res := <-ch:
for _, event := range res.Events {
rr <- &viper.RemoteResponse{
Value: event.Kv.Value,
switch event.Type {
case mvccpb.PUT:
rr <- &viper.RemoteResponse{
Value: event.Kv.Value,
}
default:
// pass
}
}
}
Expand Down

0 comments on commit c1451d6

Please sign in to comment.