Skip to content

Commit

Permalink
fix nil
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Mar 22, 2024
1 parent 07ef009 commit c0e338d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -1989,11 +1989,11 @@ func getMicroServiceServerInfo(ctx sessionctx.Context, serviceName string) ([]Se
req.Header.Add("PD-Allow-follower-handle", "true")
resp, err := util.InternalHTTPClient().Do(req)
// PD is not in the microservice mode
if resp.StatusCode == http.StatusServiceUnavailable {
if resp != nil && resp.StatusCode == http.StatusNotFound {
terror.Log(resp.Body.Close())
return servers, nil
}
if err != nil {
if err != nil || resp == nil {
ctx.GetSessionVars().StmtCtx.AppendWarning(err)
logutil.BgLogger().Warn("request microservice server info error", zap.String("service", serviceName), zap.String("url", url), zap.Error(err))
continue
Expand Down

0 comments on commit c0e338d

Please sign in to comment.