修复redis和queueprocessor
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// 会话管理
|
||||
@@ -85,9 +86,11 @@ func (c *Client) CreateSession(ctx context.Context, chatId string, req *CreateSe
|
||||
Msg string `json:"message"`
|
||||
}
|
||||
if err := c.request(ctx, "POST", path, req, &res); err != nil {
|
||||
g.Log().Errorf(ctx, "❌ CreateSession请求失败: chatId=%s, req=%+v, error=%v", chatId, req, err)
|
||||
return nil, err
|
||||
}
|
||||
if res.Code != 0 {
|
||||
g.Log().Errorf(ctx, "❌ CreateSession返回失败: chatId=%s, req=%+v, code=%d, msg=%s", chatId, req, res.Code, res.Msg)
|
||||
return nil, gerror.Newf("create session failed: %s", res.Msg)
|
||||
}
|
||||
// 检查响应数据是否为空:防止RAGFlow API返回 {"code":0, "data":null}
|
||||
|
||||
Reference in New Issue
Block a user