From 6e78e4f2096b724bf4b5d502664606baf9d664d4 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 14:29:25 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/ws_render_image_logic.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index e8770a49..f5e592c5 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -31,6 +31,11 @@ type renderImageControlChanItem struct { // 渲染发送到组装数据组装数据 func (w *wsConnectItem) renderImage(data []byte) { + defer func() { + if err := recover(); err != nil { + logx.Error("renderImage panic:", err) + } + }() var renderImageData websocket_data.RenderImageReqMsg if err := json.Unmarshal(data, &renderImageData); err != nil { w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_ERR_DATA_FORMAT, "invalid format of websocket render image message:"+string(data))) @@ -114,7 +119,7 @@ func (w *wsConnectItem) renderImage(data []byte) { func (w *wsConnectItem) assembleRenderData(taskId string, info websocket_data.RenderImageReqMsg) { defer func() { if err := recover(); err != nil { - logx.Error("MqConsumerRenderAssemble panic:", err) + logx.Error("assembleRenderData panic:", err) } }() //根据templateTag获取templateTagId(后续模板表的tag改成template_tag后可能就不需要这个步骤了)