fix
This commit is contained in:
parent
8759180068
commit
43e51b076f
|
@ -62,6 +62,10 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
|
|||
unityRenderBeginTime := info.RenderBeginTime
|
||||
//获取连接
|
||||
value, wsConnectOk := mapConnPool.Load(wid)
|
||||
var ws wsConnectItem
|
||||
if wsConnectOk {
|
||||
ws = value.(wsConnectItem)
|
||||
}
|
||||
if req.Code == 0 { //渲染成功
|
||||
//上传文件
|
||||
var upload = file.Upload{
|
||||
|
@ -82,17 +86,14 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
|
|||
})
|
||||
if err != nil {
|
||||
logx.Error("渲染回调上传文件失败:", err)
|
||||
if wsConnectOk {
|
||||
ws := value.(wsConnectItem)
|
||||
if ws.conn != nil {
|
||||
//发送错误信息给前端
|
||||
ws.renderErrResponse(requestId, info.TemplateTag, info.TaskId, "unity图片上传错误", 0, 0, 0, 0, 0, 0, 0)
|
||||
}
|
||||
return resp.SetStatusWithMessage(basic.CodeFileUploadErr, "failed to upload render resource image")
|
||||
}
|
||||
uploadUnityRenderImageTakesTime := time.Now().UTC().UnixMilli() - unityRenderEndTime
|
||||
if wsConnectOk {
|
||||
//断言连接
|
||||
ws := value.(wsConnectItem)
|
||||
if ws.conn != nil {
|
||||
//发送到出口
|
||||
ws.sendRenderResultData(websocket_data.RenderImageRspMsg{
|
||||
RequestId: requestId,
|
||||
|
@ -109,9 +110,7 @@ func (l *RenderNotifyLogic) RenderNotify(req *types.RenderNotifyReq, userinfo *a
|
|||
return resp.SetStatusWithMessage(basic.CodeOK, "success:but websocket connect not found")
|
||||
}
|
||||
//渲染失败走下面
|
||||
if wsConnectOk {
|
||||
//断言连接
|
||||
ws := value.(wsConnectItem)
|
||||
if ws.conn != nil {
|
||||
//发送错误信息给前端
|
||||
ws.renderErrResponse(requestId, info.TemplateTag, info.TaskId, "unity云渲染错误:"+req.Msg, 0, 0, 0, 0, 0, 0, 0)
|
||||
logx.Info("渲染失败且发送了失败信息")
|
||||
|
|
Loading…
Reference in New Issue
Block a user