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
9ab90200
Commit
9ab90200
authored
Aug 28, 2023
by
JiebinHu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更换redis队列
parent
6410a1b0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
cron.go
cron/cron.go
+2
-2
queue.go
domain/cache/mic_c/queue.go
+2
-2
No files found.
cron/cron.go
View file @
9ab90200
...
...
@@ -14,7 +14,7 @@ func Init() {
//gift_cron.SendGiftEventInit() // 礼物消息
//gift_cron.GiftRemark() // 礼物消息补偿
gift_cron
.
SendGiftEvent
()
// 礼物事件
//
mic_cron.OnMicCheck() // 检查上麦
mic_cron
.
OnMicCheck
()
// 检查上麦
mic_cron
.
OnMicQueue
()
// 检查上麦-队列操作
group_cron
.
GroupPowerExpClear
()
// 清理家族经验/等级
group_cron
.
GroupPowerMonthRankAct
()
...
...
domain/cache/mic_c/queue.go
View file @
9ab90200
...
...
@@ -14,14 +14,14 @@ func QueueOnMic(model *domain.Model, onMic *mic_ev.OnMicEvent) error {
queue
:=
mic_k
.
GetOnMicQueue
()
onMic
.
Ts
=
time
.
Now
()
.
UnixNano
()
// 给一个时间戳
body
,
_
:=
json
.
Marshal
(
onMic
)
return
model
.
Redis
.
RPush
(
model
,
queue
,
string
(
body
))
.
Err
()
return
model
.
Redis
Cluster
.
RPush
(
model
,
queue
,
string
(
body
))
.
Err
()
}
// redis pop on mic
func
BLPopQueueOnMic
(
model
*
domain
.
Model
)
*
mic_ev
.
OnMicEvent
{
var
res
*
mic_ev
.
OnMicEvent
queue
:=
mic_k
.
GetOnMicQueue
()
strs
,
err
:=
model
.
Redis
.
BLPop
(
model
,
time
.
Second
,
queue
)
.
Result
()
strs
,
err
:=
model
.
Redis
Cluster
.
BLPop
(
model
,
time
.
Second
,
queue
)
.
Result
()
if
err
!=
nil
{
if
err
!=
redis
.
Nil
{
model
.
Log
.
Errorf
(
"BLPopQueueOnMic fail:%v"
,
err
)
...
...
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