This commit is contained in:
laodaming 2023-08-31 12:19:02 +08:00
parent 7030846e37
commit 474cc4ddb7

View File

@ -485,8 +485,11 @@ func (w *wsConnectItem) operationRenderTask() {
case data := <-w.extendRenderProperty.renderImageTaskCtlChan:
switch data.option {
case 0: //渲染结果回调,删除任务
taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]
if !ok {
continue
}
//存在任务,则发送渲染结果给前端
if taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]; ok {
CombineTakesTime := "0ms"
UnityRenderTakesTime := "0ms"
uploadCombineImageTakesTime := "0ms"
@ -518,16 +521,17 @@ func (w *wsConnectItem) operationRenderTask() {
UploadUnityRenderImageTakesTime: uploadUnityRenderImageTakesTime,
},
}))
}
//删除任务
delete(w.extendRenderProperty.renderImageTask, data.taskId)
case 1: //新增任务
w.extendRenderProperty.renderImageTask[data.taskId] = &renderTask{
renderId: data.renderId,
}
case 2: //修改任务属性
if taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]; ok {
taskData, ok := w.extendRenderProperty.renderImageTask[data.taskId]
if !ok {
continue
}
//合图耗时
if data.taskProperty.combineTakesTime != 0 {
taskData.combineTakesTime = data.taskProperty.combineTakesTime
@ -552,4 +556,3 @@ func (w *wsConnectItem) operationRenderTask() {
}
}
}
}