Commit 55ac5ee5 authored by hujiebin's avatar hujiebin

feat:测服搞成0

parent ba802a38
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/resource/config"
"git.hilo.cn/hilo-common/resource/redisCli" "git.hilo.cn/hilo-common/resource/redisCli"
"github.com/bluele/gcache" "github.com/bluele/gcache"
redis2 "github.com/go-redis/redis/v8" redis2 "github.com/go-redis/redis/v8"
...@@ -89,8 +90,12 @@ func MGetRoomVisitCount(groupIds []string) (map[string]string, error) { ...@@ -89,8 +90,12 @@ func MGetRoomVisitCount(groupIds []string) (map[string]string, error) {
} }
// 用redisCluster中的zset代替,只是取出大于100的 // 用redisCluster中的zset代替,只是取出大于100的
zKey := redis_key.GetPrefixRoomVisitCountZset() zKey := redis_key.GetPrefixRoomVisitCountZset()
cnt := 100
if !config.AppIsRelease() {
cnt = 0
}
zRes, err := redisCli.GetClusterRedis().ZRevRangeByScoreWithScores(context.Background(), zKey, &redis2.ZRangeBy{ zRes, err := redisCli.GetClusterRedis().ZRevRangeByScoreWithScores(context.Background(), zKey, &redis2.ZRangeBy{
Min: fmt.Sprintf("%d", 100), // 100人数以上的。 Min: fmt.Sprintf("%d", cnt), // 100人数以上的。
Max: "+inf", Max: "+inf",
}).Result() }).Result()
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment