Skip to content

Commit

Permalink
Fix the select fallthrough
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Jan 8, 2024
1 parent 1051bd2 commit 77d69d4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,17 @@ func (ci *clientInner) doRequest(
}

func (ci *clientInner) membersInfoUpdater(ctx context.Context) {
ci.updateMembersInfo(ctx)
log.Info("[pd] http client member info updater started", zap.String("source", ci.source))
ticker := time.NewTicker(defaultMembersInfoUpdateInterval)
defer ticker.Stop()
for {
ci.updateMembersInfo(ctx)
select {
case <-ctx.Done():
log.Info("[pd] http client member info updater stopped", zap.String("source", ci.source))
return
case <-ticker.C:
case <-ci.updateMembersInfoNotifier:
ci.updateMembersInfo(ctx)
}
}
}
Expand Down

0 comments on commit 77d69d4

Please sign in to comment.