From e434d11bd0a146cac651ba9e8ab653e4bf83ba81 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 3 Nov 2023 14:05:17 +0800 Subject: [PATCH] fix --- server/websocket/internal/logic/getstatlogic.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/websocket/internal/logic/getstatlogic.go b/server/websocket/internal/logic/getstatlogic.go index f6490893..104491c4 100644 --- a/server/websocket/internal/logic/getstatlogic.go +++ b/server/websocket/internal/logic/getstatlogic.go @@ -51,8 +51,14 @@ func (l *GetStatLogic) GetStat(req *types.GetStatReq, userinfo *auth.UserInfo) ( } } } else { //不指定用户 + i := 0 mapUserWsStat.Range(func(key, value any) bool { + //不指定最多获取1000个用户 + if i > 1000 { + return false + } userStat[key.(string)] = value + i++ return true }) }