diff --git a/domain/cache/room_c/userRoomVisit.go b/domain/cache/room_c/userRoomVisit.go index 94e24e653a7efee6b841bbb64f273bc33f0e5e0b..b46c21a3efd1ddcda192103b03440186de5b44ca 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 bffc046c00b2ef3093e6261d5893791df20ab420..9ccd855d4f08232b4cd262a4b616c4e1276cd238 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 }