mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-28 11:16:31 +08:00
Go: fix error handle (#18573)
As title Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -951,6 +951,10 @@ func (h *Handler) PullMessageFromQueue(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
messages, err := msgQueueEngine.GetMessages(req.MessageCount)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, common.CodeBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
var result []map[string]string
|
||||
if req.AckPolicy == "ACK" {
|
||||
for _, message := range messages {
|
||||
|
||||
@@ -377,7 +377,7 @@ func queueMemoryTask(ctx context.Context, memoryID, tenantID string, rawMessageI
|
||||
if err != nil {
|
||||
return fmt.Errorf("marshal memory task message: %w", err)
|
||||
}
|
||||
if err := mq.PublishTask(common.TaskSubject, tmPayload); err != nil {
|
||||
if err = mq.PublishTask(common.TaskSubject, tmPayload); err != nil {
|
||||
return fmt.Errorf("publish memory task %s: %w", taskID, err)
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user