From 36aad6a0887b812998f6eb74d9092a6aae456c00 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Wed, 26 Jul 2023 15:15:37 +0800 Subject: [PATCH] fix --- .../internal/logic/datatransferlogic.go | 19 ------------------- .../internal/logic/ws_render_image_logic.go | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index ec9969dd..3df09209 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -177,25 +177,6 @@ func (w *wsConnectItem) close() { logx.Info("websocket:", w.flag, " is closed") } -// 操作连接中渲染任务的增加/删除 -func (w *wsConnectItem) operationRenderTask() { - for { - select { - case <-w.closeChan: - return - case data := <-w.renderImageTaskCtlChan: - switch data.Option { - case 0: //删除 - delete(w.renderImageTask, data.Key) - case 1: //新增 - w.renderImageTask[data.Key] = struct{}{} - default: - - } - } - } -} - // 读取输出返回给客户端 func (w *wsConnectItem) writeLoop() { for { diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 40c07f1e..6a075acb 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -23,3 +23,22 @@ func (w *wsConnectItem) SendToCloudRender(data []byte) { } } } + +// 操作连接中渲染任务的增加/删除 +func (w *wsConnectItem) operationRenderTask() { + for { + select { + case <-w.closeChan: + return + case data := <-w.renderImageTaskCtlChan: + switch data.Option { + case 0: //删除任务 + delete(w.renderImageTask, data.Key) + case 1: //新增任务 + w.renderImageTask[data.Key] = struct{}{} + default: + + } + } + } +}