This commit is contained in:
liuxiaobo 2025-05-31 23:36:16 +08:00
parent da1f14b7dd
commit 5e9b3922a1

View File

@ -2,6 +2,7 @@ package userBindService
import (
"context"
"errors"
"fmt"
"game/common/proto/pb"
"game/common/utils"
@ -43,7 +44,9 @@ func (m *UserBindService) makeRedisKey(userId int64, typeId pb.ServiceTypeId) st
func (m *UserBindService) LoadFromRedis(userId int64, typeId pb.ServiceTypeId) string {
k := m.makeRedisKey(userId, typeId)
if sName, err := m.rdb.Get(context.Background(), k).Result(); err != nil {
log.Error(err.Error())
if !errors.Is(err, redis.Nil) {
log.Error(err.Error())
}
return ""
} else {
return sName