diff --git a/server/websocket/internal/logic/datatransferlogic.go b/server/websocket/internal/logic/datatransferlogic.go index ca5d3bb9..974e3bf6 100644 --- a/server/websocket/internal/logic/datatransferlogic.go +++ b/server/websocket/internal/logic/datatransferlogic.go @@ -67,9 +67,9 @@ var ( //websocket连接存储 mapConnPool = sync.Map{} //每个websocket连接入口缓冲队列长度默认值 - websocketInChanLen = 500 + websocketInChanLen = 50 //每个websocket连接出口缓冲队列长度默认值 - websocketOutChanLen = 500 + websocketOutChanLen = 50 //是否开启debug openDebug = true //允许跨域的origin @@ -400,9 +400,6 @@ func (w *wsConnectItem) sendToOutChan(data []byte) { return case w.outChan <- data: return - case <-time.After(time.Millisecond * 50): //阻塞超过50ms丢弃 - logx.Error("failed to send to out chan,time expired,data:", string(data)) - return } } @@ -413,9 +410,6 @@ func (w *wsConnectItem) sendToInChan(data []byte) { return case w.inChan <- data: return - case <-time.After(time.Millisecond * 200): //200豪秒超时丢弃,说明超过消费速度了 - w.sendToOutChan(w.respondDataFormat(constants.WEBSOCKET_INCOME_CACHE_QUEUE_OVERFLOW, "send message is too frequent,the message is ignore by system:"+string(data))) - return } } diff --git a/server/websocket/internal/logic/ws_render_image.go b/server/websocket/internal/logic/ws_render_image.go index f1ac5270..41f6e070 100644 --- a/server/websocket/internal/logic/ws_render_image.go +++ b/server/websocket/internal/logic/ws_render_image.go @@ -21,7 +21,7 @@ import ( var ( //每个websocket渲染任务缓冲队列长度默认值 - renderChanLen = 500 + renderChanLen = 20 ) // 渲染处理器 @@ -42,8 +42,6 @@ func (r *renderProcessor) allocationMessage(w *wsConnectItem, data []byte) { return case w.extendRenderProperty.renderChan <- data: //发入到缓冲队列 return - case <-time.After(time.Second * 3): //三秒没进入缓冲队列就丢弃 - return } }