From 9131b06c8d90127e28273fcb5c1694f85598b967 Mon Sep 17 00:00:00 2001 From: qhd <1766646056@qq.com> Date: Wed, 8 Jul 2026 13:36:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A2=9E=E5=8A=A0=E8=AF=BB=E5=8F=96OSS?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E9=87=8D=E8=AF=95=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/prompt/prompt_compose_service.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/service/prompt/prompt_compose_service.go b/service/prompt/prompt_compose_service.go index 4637b5f..9f8ee21 100644 --- a/service/prompt/prompt_compose_service.go +++ b/service/prompt/prompt_compose_service.go @@ -143,10 +143,16 @@ func Callback(ctx context.Context, req *dto.CallbackReq) error { // 2) 读取 OSS 文件内容 var ossContent []byte if req.OssFile != "" { - ossContent, err = gateway.GetFileBytesFromURL(ctx, req.OssFile) - if err != nil { - g.Log().Infof(ctx, "[回调处理] 读取OSS文件 taskId=%s,state=%v,ossFile=%v", req.TaskId, req.State, req.OssFile) - g.Log().Warningf(ctx, "[回调处理] 读取OSS失败 taskId=%s err=%v", req.TaskId, err) + for attempt := 0; attempt <= 5; attempt++ { + ossContent, err = gateway.GetFileBytesFromURL(ctx, req.OssFile) + if err != nil { + g.Log().Infof(ctx, "[回调处理] 读取OSS文件 taskId=%s,state=%v,ossFile=%v", req.TaskId, req.State, req.OssFile) + g.Log().Warningf(ctx, "[回调处理] 读取OSS失败 taskId=%s err=%v", req.TaskId, err) + } + if err == nil { + g.Log().Infof(ctx, "[回调处理] 读取OSS成功 taskId=%s,state=%v,ossFile=%v", req.TaskId, req.State, req.OssFile) + break + } } }