mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-27 10:52:03 +08:00
Go: add context, part4 (#17381)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -1019,7 +1019,8 @@ func (h *Handler) RemoveIngestionTasks(c *gin.Context) {
|
||||
}
|
||||
|
||||
if req.Email == nil && req.Status == nil {
|
||||
tasks, err := h.service.RemoveIngestionTasks(req.Tasks)
|
||||
ctx := c.Request.Context()
|
||||
tasks, err := h.service.RemoveIngestionTasks(ctx, req.Tasks)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, handler.IngestionTaskErrorCode(err), err.Error())
|
||||
return
|
||||
@@ -1050,7 +1051,8 @@ func (h *Handler) StopIngestionTasks(c *gin.Context) {
|
||||
}
|
||||
|
||||
if req.Email == nil && req.Status == nil {
|
||||
tasks, err := h.service.StopIngestionTasks(req.Tasks)
|
||||
ctx := c.Request.Context()
|
||||
tasks, err := h.service.StopIngestionTasks(ctx, req.Tasks)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, handler.IngestionTaskErrorCode(err), err.Error())
|
||||
return
|
||||
@@ -1085,7 +1087,8 @@ func (h *Handler) ListIngestionTasks(c *gin.Context) {
|
||||
var tasks []map[string]interface{}
|
||||
var req ListIngestionTasksRequest
|
||||
if err = c.ShouldBindJSON(&req); err != nil {
|
||||
tasks, err = h.service.ListIngestionTasks()
|
||||
ctx := c.Request.Context()
|
||||
tasks, err = h.service.ListIngestionTasks(ctx)
|
||||
} else {
|
||||
tasks, err = h.service.ListIngestionTasksByCondition(req.Email, req.Status)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user