From 9ab9020026557084be5ae905bd362f456ef27461 Mon Sep 17 00:00:00 2001 From: JiebinHu <458249864@qq.com> Date: Mon, 28 Aug 2023 00:50:50 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=9B=B4=E6=8D=A2redis=E9=98=9F?= =?UTF-8?q?=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron/cron.go | 4 ++-- domain/cache/mic_c/queue.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cron/cron.go b/cron/cron.go index d752a01..6acb656 100644 --- a/cron/cron.go +++ b/cron/cron.go @@ -13,8 +13,8 @@ func Init() { } //gift_cron.SendGiftEventInit() // 礼物消息 //gift_cron.GiftRemark() // 礼物消息补偿 - gift_cron.SendGiftEvent() // 礼物事件 - //mic_cron.OnMicCheck() // 检查上麦 + gift_cron.SendGiftEvent() // 礼物事件 + mic_cron.OnMicCheck() // 检查上麦 mic_cron.OnMicQueue() // 检查上麦-队列操作 group_cron.GroupPowerExpClear() // 清理家族经验/等级 group_cron.GroupPowerMonthRankAct() diff --git a/domain/cache/mic_c/queue.go b/domain/cache/mic_c/queue.go index e717b86..c4d6277 100644 --- a/domain/cache/mic_c/queue.go +++ b/domain/cache/mic_c/queue.go @@ -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.RedisCluster.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.RedisCluster.BLPop(model, time.Second, queue).Result() if err != nil { if err != redis.Nil { model.Log.Errorf("BLPopQueueOnMic fail:%v", err) -- 2.22.0