From 5d926a287df1aee86e41e601bb16c063f1246c49 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 25 Aug 2023 15:06:09 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/commonnotifylogic.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,