修改
This commit is contained in:
parent
da1f14b7dd
commit
5e9b3922a1
@ -2,6 +2,7 @@ package userBindService
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"game/common/proto/pb"
|
"game/common/proto/pb"
|
||||||
"game/common/utils"
|
"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 {
|
func (m *UserBindService) LoadFromRedis(userId int64, typeId pb.ServiceTypeId) string {
|
||||||
k := m.makeRedisKey(userId, typeId)
|
k := m.makeRedisKey(userId, typeId)
|
||||||
if sName, err := m.rdb.Get(context.Background(), k).Result(); err != nil {
|
if sName, err := m.rdb.Get(context.Background(), k).Result(); err != nil {
|
||||||
|
if !errors.Is(err, redis.Nil) {
|
||||||
log.Error(err.Error())
|
log.Error(err.Error())
|
||||||
|
}
|
||||||
return ""
|
return ""
|
||||||
} else {
|
} else {
|
||||||
return sName
|
return sName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user