diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index eeb22e0e..47923597 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -360,6 +360,14 @@ func (w *wsConnectItem) assembleRenderData(taskId string, combineImage string, i // 增加渲染任务 func (w *wsConnectItem) createRenderTask(data renderImageControlChanItem) { + if data.taskId == "" { + logx.Error("task_id不能为空") + return + } + if data.renderId == "" { + logx.Error("render_id不能为空") + return + } //强制设为增加 data.option = 1 select { @@ -374,6 +382,10 @@ func (w *wsConnectItem) createRenderTask(data renderImageControlChanItem) { // 渲染回调处理并删除渲染任务 func (w *wsConnectItem) deleteRenderTask(data renderImageControlChanItem) { + if data.taskId == "" { + logx.Error("task_id不能为空") + return + } //强制设为删除 data.option = 0 select { @@ -389,10 +401,10 @@ func (w *wsConnectItem) deleteRenderTask(data renderImageControlChanItem) { // 修改任务属性(只有耗时属性可以更新) func (w *wsConnectItem) modifyRenderTaskProperty(data renderImageControlChanItem) { if data.taskId == "" { - logx.Error("设置耗时属性需要的task_id不能为空") + logx.Error("task_id不能为空") return } - //强制设为修改耗时属性 + //强制设为修改任务属性 data.option = 2 select { case <-w.closeChan: //关闭