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