Skip to content

Commit

Permalink
Resolve the conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Aug 1, 2024
1 parent c8d08d2 commit 97da4ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/apiutil/serverapi/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (h *redirector) waitForLeader(r *http.Request) (leader *pdpb.Member) {
}
case <-r.Context().Done():
return
case <-h.s.LoopContext().Done():
case <-h.s.Context().Done():
return
}
}
Expand Down
5 changes: 3 additions & 2 deletions tests/server/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,10 @@ func (suite *redirectorTestSuite) TestRedirect() {
err := leader.ResignLeader()
re.NoError(err)
for _, svr := range suite.cluster.GetServers() {
url := fmt.Sprintf("%s/pd/api/v1/version", svr.GetServer().GetAddr())
request, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/pd/api/v1/version", svr.GetServer().GetAddr()), http.NoBody)
re.NoError(err)
testutil.Eventually(re, func() bool {
resp, err := tests.TestDialClient.Get(url)
resp, err := dialClient.Do(request)
re.NoError(err)
defer resp.Body.Close()
_, err = io.ReadAll(resp.Body)
Expand Down

0 comments on commit 97da4ea

Please sign in to comment.