From 5f47802c315e21cab5cc183d58acf287cc9d85c9 Mon Sep 17 00:00:00 2001 From: chenweijian <820961417@qq.com> Date: Wed, 23 Aug 2023 15:33:15 +0800 Subject: [PATCH] group support --- cron/gift_cron/send_gift_redis.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cron/gift_cron/send_gift_redis.go b/cron/gift_cron/send_gift_redis.go index d2216a1..a393ae2 100644 --- a/cron/gift_cron/send_gift_redis.go +++ b/cron/gift_cron/send_gift_redis.go @@ -101,7 +101,9 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift //if time.Now().Unix() <= 1692964800 { // cwj---- // return nil //} + model.Log.Infof("groupSupportAddConsume UserId:%d, sendGiftEvent:%+v", sendGiftEvent.SendUserId, sendGiftEvent) if sendGiftEvent.SceneType != gift_e.GroupSceneType || sendGiftEvent.SceneUid == "" { + model.Log.Infof("groupSupportAddConsume UserId:%d, sendGiftEvent:%+v", sendGiftEvent.SendUserId, sendGiftEvent) return } _, _, period := group_m.GetSupportLevelTime(time.Now()) @@ -110,23 +112,23 @@ func groupSupportAddConsume(model *domain.Model, sendGiftEvent *gift_ev.SendGift keyDiamond := rediskey.GetGroupSupportConsumeSummary(period) _, err := model.RedisCluster.ZIncrBy(context.Background(), keyDiamond, float64(diamond), sendGiftEvent.SceneUid).Result() if err != nil { - model.Log.Errorf("AddSendGiftEventAsync groupSupport key:%s, val:%d, member:%s, err:%v", + model.Log.Errorf("groupSupportAddConsume key:%s, val:%d, member:%s, err:%v", keyDiamond, diamond, sendGiftEvent.SceneUid, err) } err = redisCli.SetExpire(model.RedisCluster, keyDiamond, time.Hour*24*14) // 保留两周 if err != nil { - model.Log.Errorf("AddSendGiftEventAsync groupSupport key:%s, val:%d, member:%s, err:%v", + model.Log.Errorf("groupSupportAddConsume key:%s, val:%d, member:%s, err:%v", keyDiamond, diamond, sendGiftEvent.SceneUid, err) } // 支持者数量 keySupportNum := rediskey.GetGroupSupportCountSupporter(period, sendGiftEvent.SceneUid) err = model.RedisCluster.SAdd(context.Background(), keySupportNum, sendGiftEvent.SendUserId).Err() if err != nil { - model.Log.Errorf("AddSendGiftEventAsync groupSupport key:%s, UserId:%d, err:%v", keySupportNum, sendGiftEvent.SendUserId, err) + model.Log.Errorf("groupSupportAddConsume key:%s, UserId:%d, err:%v", keySupportNum, sendGiftEvent.SendUserId, err) } err = redisCli.SetExpire(model.RedisCluster, keySupportNum, time.Hour*24*14) // 保留两周 if err != nil { - model.Log.Errorf("AddSendGiftEventAsync groupSupport key:%s, UserId:%d, err:%v", keySupportNum, sendGiftEvent.SendUserId, err) + model.Log.Errorf("groupSupportAddConsume key:%s, UserId:%d, err:%v", keySupportNum, sendGiftEvent.SendUserId, err) } return } -- 2.22.0