This commit is contained in:
laodaming 2023-08-25 15:06:09 +08:00
parent a635a2f546
commit 5d926a287d

View File

@ -41,7 +41,7 @@ func (l *CommonNotifyLogic) pushCommonCache(data commonConnectionNotFoundDataCac
select { select {
case commonConnectionNotFoundDataCacheChan <- data: case commonConnectionNotFoundDataCacheChan <- data:
return return
case <-time.After(time.Second): //超1秒就丢弃 case <-time.After(time.Millisecond * 50): //超50ms就丢弃
return return
} }
} }
@ -105,7 +105,7 @@ func (l *CommonNotifyLogic) CommonNotify(req *types.CommonNotifyReq, userinfo *a
value, ok := mapConnPool.Load(req.Wid) value, ok := mapConnPool.Load(req.Wid)
if !ok { if !ok {
//没找到连接就放到公共缓冲队列 //没找到连接就放到公共缓冲队列
l.pushCommonCache(commonConnectionNotFoundDataCacheChanItem{ go l.pushCommonCache(commonConnectionNotFoundDataCacheChanItem{
retryTimes: 4, //重试4次 retryTimes: 4, //重试4次
data: types.CommonNotifyReq{ data: types.CommonNotifyReq{
Wid: req.Wid, Wid: req.Wid,