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
577a8fef
Commit
577a8fef
authored
Sep 06, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:同步在mic上的人
parent
80afaac2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
on_mic.go
cron/mic_cron/on_mic.go
+8
-0
No files found.
cron/mic_cron/on_mic.go
View file @
577a8fef
package
mic_cron
package
mic_cron
import
(
import
(
"fmt"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"github.com/robfig/cron"
"github.com/robfig/cron"
"hilo-group/_const/redis_key/mic_k"
"hilo-group/domain/cache/mic_c"
"hilo-group/domain/cache/mic_c"
"hilo-group/domain/event/mic_ev"
"hilo-group/domain/event/mic_ev"
"hilo-group/domain/model/group_m"
"hilo-group/domain/model/group_m"
...
@@ -24,6 +26,7 @@ func OnMicCheck() {
...
@@ -24,6 +26,7 @@ func OnMicCheck() {
return
return
}
}
for
_
,
groupId
:=
range
groupIds
{
for
_
,
groupId
:=
range
groupIds
{
onGroupMicKey
:=
mic_k
.
GetGroupOnMicUser
(
groupId
)
// 同步在mic上的人
//遍历每个麦位
//遍历每个麦位
for
i
:=
1
;
i
<=
group_m
.
MaxMicNum
;
i
++
{
for
i
:=
1
;
i
<=
group_m
.
MaxMicNum
;
i
++
{
micUser
,
err
:=
group_m
.
GetMicUser
(
model
,
groupId
,
i
)
micUser
,
err
:=
group_m
.
GetMicUser
(
model
,
groupId
,
i
)
...
@@ -41,6 +44,11 @@ func OnMicCheck() {
...
@@ -41,6 +44,11 @@ func OnMicCheck() {
});
err
!=
nil
{
});
err
!=
nil
{
model
.
Log
.
Errorf
(
"QueueOnMic fail:%v"
,
err
)
model
.
Log
.
Errorf
(
"QueueOnMic fail:%v"
,
err
)
}
}
// 设置mic上的人
model
.
Redis
.
HSet
(
model
,
onGroupMicKey
,
i
,
micUser
.
UserId
)
}
else
{
// 删除mic上的人
model
.
Redis
.
HDel
(
model
,
onGroupMicKey
,
fmt
.
Sprintf
(
"%d"
,
i
))
}
}
}
}
}
}
...
...
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