From a29fdf93f74df92e42fc7df546d718e4068be7ca Mon Sep 17 00:00:00 2001 From: JiebinHu <458249864@qq.com> Date: Sat, 26 Aug 2023 18:52:40 +0800 Subject: [PATCH] =?UTF-8?q?hgetall=20=E6=94=B9=E6=88=90mget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- domain/cache/room_c/userRoomVisit.go | 1 + route/group_r/group_list.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/domain/cache/room_c/userRoomVisit.go b/domain/cache/room_c/userRoomVisit.go index 94e24e6..b46c21a 100644 --- a/domain/cache/room_c/userRoomVisit.go +++ b/domain/cache/room_c/userRoomVisit.go @@ -121,6 +121,7 @@ func clearRoomVisit(groupId string, t time.Time) (int64, error) { return ret, nil } +// Deprecated: hgetall有问题 func GetAllRoomVisitCount() (map[string]string, error) { key := redis_key.GetPrefixRoomVisitCount() return redisCli.GetRedis().HGetAll(context.Background(), key).Result() diff --git a/route/group_r/group_list.go b/route/group_r/group_list.go index bffc046..9ccd855 100644 --- a/route/group_r/group_list.go +++ b/route/group_r/group_list.go @@ -1467,8 +1467,13 @@ func getCandidatesByCountry(model *domain.Model, bannedGroups map[string]uint64, if err != nil { return nil, 0, nil, err } + var groupIds []string + for _, v := range noPwdGroups { + groupIds = append(groupIds, v.ImGroupId) // imGroupId + } - roomVisitCount, err := room_c.GetAllRoomVisitCount() + //roomVisitCount, err := room_c.GetAllRoomVisitCount() + roomVisitCount, err := room_c.MGetRoomVisitCount(groupIds) if err != nil { return nil, 0, nil, err } -- 2.22.0