fix
This commit is contained in:
parent
b230d764e0
commit
f7c0d90ab3
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user