Skip to content

Commit

Permalink
cc
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <1045931706@qq.com>
  • Loading branch information
bufferflies committed Jul 31, 2023
1 parent fe52361 commit 4d7a8ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/grpc_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2363,6 +2363,10 @@ func (s *GrpcServer) WatchGlobalConfig(req *pdpb.WatchGlobalConfigRequest, serve
// - If required revision < CompactRevision, we need to reload all configs to avoid losing data.
// - If required revision >= CompactRevision, just keep watching.
// Use WithPrevKV() to get the previous key-value pair when get Delete Event.
if s.client == nil {
log.Warn("WatchGlobalConfig panic, etcd client is nil")
//return errors.New("etcd client is nil")

Check failure on line 2368 in server/grpc_service.go

View workflow job for this annotation

GitHub Actions / statics

commentFormatting: put a space between `//` and comment text (gocritic)
}
watchChan := s.client.Watch(ctx, configPath, clientv3.WithPrefix(), clientv3.WithRev(revision), clientv3.WithPrevKV())
for {
select {
Expand Down
1 change: 1 addition & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ func (s *Server) startEtcd(ctx context.Context) error {
}

// start client
log.Info("start init etcd client")
s.client, s.httpClient, err = s.startClient()
if err != nil {
return err
Expand Down

0 comments on commit 4d7a8ef

Please sign in to comment.