mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-27 10:52:03 +08:00
Go: add context (#17314)
### Summary As title. --------- Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -116,8 +116,9 @@ func (h *AgentHandler) UploadAgentFile(c *gin.Context) {
|
||||
// into the normal UploadInfos path. We replicate that with a
|
||||
// guard that dispatches to UploadFromURL only when both
|
||||
// conditions are met.
|
||||
ctx := c.Request.Context()
|
||||
if url := c.Query("url"); url != "" && len(files) == 1 {
|
||||
uploaded, err := h.fileService.UploadFromURL(user.ID, url)
|
||||
uploaded, err := h.fileService.UploadFromURL(ctx, user.ID, url)
|
||||
if err != nil {
|
||||
common.ResponseWithCodeData(c, common.CodeServerError, nil, err.Error())
|
||||
return
|
||||
@@ -132,7 +133,7 @@ func (h *AgentHandler) UploadAgentFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
results, err := h.fileService.UploadInfos(user.ID, files)
|
||||
results, err := h.fileService.UploadInfos(ctx, user.ID, files)
|
||||
if err != nil {
|
||||
common.ResponseWithCodeData(c, common.CodeServerError, nil, err.Error())
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user