Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujiebin
hilo-group
Commits
55ac5ee5
Commit
55ac5ee5
authored
Aug 30, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:测服搞成0
parent
ba802a38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
userRoomVisit.go
domain/cache/room_c/userRoomVisit.go
+6
-1
No files found.
domain/cache/room_c/userRoomVisit.go
View file @
55ac5ee5
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment