Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen committed Nov 15, 2023
1 parent dd2265b commit 495fff0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cdc/api/v2/changefeed.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,18 +600,20 @@ func (h *OpenAPIV2) resumeChangefeed(c *gin.Context) {
_ = c.Error(err)
return
}
// use the default pdClient
pdClient = up.PDClient
} else {
credential := cfg.PDConfig.toCredential()
timeoutCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
// create a new pdClient
pdClient, err = h.helpers.getPDClient(timeoutCtx, cfg.PDAddrs, credential)
if err != nil {
_ = c.Error(cerror.WrapError(cerror.ErrAPIInvalidParam, err))
return
}
defer pdClient.Close()
}
defer pdClient.Close()

if err := h.helpers.verifyResumeChangefeedConfig(
ctx,
Expand Down

0 comments on commit 495fff0

Please sign in to comment.