From 5e9b3922a17a640610193cd8d2299347edaf7f0e Mon Sep 17 00:00:00 2001 From: liuxiaobo <1224730913@qq.com> Date: Sat, 31 May 2025 23:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/userBindService/userService.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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