diff --git a/common/userBindService/userService.go b/common/userBindService/userService.go index acd0821..a6f7e16 100644 --- a/common/userBindService/userService.go +++ b/common/userBindService/userService.go @@ -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