From 42fae2b6fc02cbc77191178d59c92d7348174529 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 31 Oct 2023 17:56:53 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/getstatlogic.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/websocket/internal/logic/getstatlogic.go b/server/websocket/internal/logic/getstatlogic.go index 5bbf0d21..c0d557aa 100644 --- a/server/websocket/internal/logic/getstatlogic.go +++ b/server/websocket/internal/logic/getstatlogic.go @@ -44,6 +44,10 @@ func (l *GetStatLogic) GetStat(req *types.GetStatReq, userinfo *auth.UserInfo) ( statData, ok := mapUserWsStat.Load(key) if ok { //存在就累加 if stat, ok := statData.(mapUserWsStatItem); ok { + //连接数等于0的用户就不返回 + if stat.CurWsConnectCount == 0 { + return true + } currentWebsocketConnectCount += stat.CurWsConnectCount currentRequestCombineApiCount += stat.CurCombineCount } else {