Go: fix go context (#18052)

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-08-10 18:04:17 +08:00
committed by GitHub
parent 6f9d158e30
commit c697fcff41
26 changed files with 97 additions and 86 deletions

View File

@@ -1524,7 +1524,8 @@ func (h *AgentHandler) TestDBConnection(c *gin.Context) {
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "Invalid request: "+err.Error())
return
}
code, err := h.agentService.TestDBConnection(user.ID, &req)
ctx := c.Request.Context()
code, err := h.agentService.TestDBConnection(ctx, user.ID, &req)
if err != nil {
common.ErrorWithCode(c, code, err.Error())
return