This commit is contained in:
laodaming 2023-10-10 14:15:43 +08:00
parent 019a717706
commit 3f0d8d017e

View File

@ -92,7 +92,7 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
ws, ok := value.(wsConnectItem)
if !ok {
logx.Error("渲染回调断言websocket连接失败")
return resp.SetStatusWithMessage(basic.CodeFileUploadErr, "渲染回调断言websocket连接失败")
return resp.SetStatusWithMessage(basic.CodeServiceErr, "渲染回调断言websocket连接失败")
}
//发送到出口
ws.sendRenderResultData(websocket_data.RenderImageRspMsg{
@ -106,6 +106,7 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
logx.Info("渲染回调成功,渲染结果图片为:", uploadRes.ResourceUrl)
return resp.SetStatusWithMessage(basic.CodeOK, "success")
}
logx.Info("渲染成功但找不到ws连接")
return resp.SetStatusWithMessage(basic.CodeOK, "successbut websocket connect not found")
}
//渲染失败走下面
@ -114,10 +115,13 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
ws, ok := value.(wsConnectItem)
if !ok {
logx.Error("渲染回调断言websocket连接失败")
return resp.SetStatusWithMessage(basic.CodeFileUploadErr, "渲染回调断言websocket连接失败")
return resp.SetStatusWithMessage(basic.CodeServiceErr, "渲染回调断言websocket连接失败")
}
//发送错误信息给前端
ws.renderErrResponse(renderId, info.TemplateTag, info.TaskId, "unity云渲染错误:"+req.Msg, 0, 0, 0, 0, 0, 0, 0)
logx.Info("渲染失败且发送了失败信息")
} else {
logx.Info("渲染失败且找不到ws连接")
}
return resp.SetStatusWithMessage(basic.CodeOK, "success")
}