...
 
Commits (5)
...@@ -14,7 +14,7 @@ const EventSendGiftHiloUserQueue = "send:gift:queue:hilo_user" ...@@ -14,7 +14,7 @@ const EventSendGiftHiloUserQueue = "send:gift:queue:hilo_user"
func BLPopQueueSendGift(model *domain.Model) *gift_ev.SendGiftEvent { func BLPopQueueSendGift(model *domain.Model) *gift_ev.SendGiftEvent {
var res *gift_ev.SendGiftEvent var res *gift_ev.SendGiftEvent
queue := EventSendGiftHiloUserQueue queue := EventSendGiftHiloUserQueue
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 != nil {
if err != redis.Nil { if err != redis.Nil {
model.Log.Errorf("BLPopQueueSendGift fail:%v", err) model.Log.Errorf("BLPopQueueSendGift fail:%v", err)
......
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mylogrus" "git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/resource/mysql" "git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/redisCli"
"hilo-user/_const/redis_key/group_k" "hilo-user/_const/redis_key/group_k"
"hilo-user/myerr" "hilo-user/myerr"
"strconv" "strconv"
...@@ -26,7 +25,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql. ...@@ -26,7 +25,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
return nil, myerr.WrapErr(err) return nil, myerr.WrapErr(err)
} }
groupUserIdstrs, err := redisCli.GetRedis().ZRange(model, key, 0, -1).Result() groupUserIdstrs, err := model.RedisCluster.ZRange(model, key, 0, -1).Result()
if err != nil { if err != nil {
return nil, myerr.WrapErr(err) return nil, myerr.WrapErr(err)
} }
...@@ -34,7 +33,6 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql. ...@@ -34,7 +33,6 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
resultUserSet := map[mysql.ID]string{} resultUserSet := map[mysql.ID]string{}
for i, _ := range groupUserIdstrs { for i, _ := range groupUserIdstrs {
tempGroupUid, userId := analysisMemberStr(groupUserIdstrs[i]) tempGroupUid, userId := analysisMemberStr(groupUserIdstrs[i])
mylogrus.MyLog.Debugf("RoomLivingUserIdFilter, analysisMemberStr %s, %d", tempGroupUid, userId)
if _, flag := userIdSet[userId]; flag { if _, flag := userIdSet[userId]; flag {
resultUserSet[userId] = tempGroupUid resultUserSet[userId] = tempGroupUid
...@@ -44,7 +42,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql. ...@@ -44,7 +42,7 @@ func RoomLivingUserIdFilter(model *domain.Model, userIds []mysql.ID) (map[mysql.
} }
func ClearExpired(model *domain.Model, key string, expireSec int64) error { func ClearExpired(model *domain.Model, key string, expireSec int64) error {
return model.Redis.ZRemRangeByScore(model, key, return model.RedisCluster.ZRemRangeByScore(model, key,
"0", strconv.FormatInt(time.Now().Unix()-expireSec, 10)).Err() "0", strconv.FormatInt(time.Now().Unix()-expireSec, 10)).Err()
} }
......