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
c1cf069e
Commit
c1cf069e
authored
Aug 26, 2023
by
JiebinHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:去掉无用的大key
parent
b1a5481e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
mic.go
domain/model/group_m/mic.go
+8
-6
No files found.
domain/model/group_m/mic.go
View file @
c1cf069e
...
...
@@ -824,12 +824,14 @@ func groupMicHasIn(model *domain.Model, groupId string, userId mysql.ID) {
}
else
{
println
(
n
)
}
if
_
,
err
:=
redisCli
.
GetRedis
()
.
ZAdd
(
context
.
Background
(),
redis_key
.
GetPrefixGroupMicHasInUserTime
(),
&
redis2
.
Z
{
Score
:
float64
(
time
.
Now
()
.
Unix
()),
Member
:
getMemberStr
(
groupId
,
userId
),
})
.
Result
();
err
!=
nil
{
model
.
Log
.
Errorf
(
"groupMicHasIn redis:GetPrefixGroupMicHasInTime groupId:%v err:%v"
,
groupId
,
err
)
}
// 下面的是只写,不查的。 todo 直接干掉???
// 只是知道用户在哪个时间点上了哪个群的麦,但是不知道上了哪个麦位置, 而且micUser已经有统计这些信息了
//if _, err := redisCli.GetRedis().ZAdd(context.Background(), redis_key.GetPrefixGroupMicHasInUserTime(), &redis2.Z{
// Score: float64(time.Now().Unix()),
// Member: getMemberStr(groupId, userId),
//}).Result(); err != nil {
// model.Log.Errorf("groupMicHasIn redis:GetPrefixGroupMicHasInTime groupId:%v err:%v", groupId, err)
//}
}
const
micHasInScript
=
"local flag = redis.call('EXISTS', '{key1}', '{key2}', '{key3}', '{key4}', '{key5}', '{key6}', '{key7}', '{key8}', '{key9}', '{key10}', '{key11}', '{key12}', '{key13}', '{key14}', '{key15}', '{key16}', '{key17}', '{key18}', '{key19}', '{key20}') if flag == 0 then redis.call('Srem', '{key}', '{remKey}') end return flag "
...
...
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