From efa3e9999955d5bbe1ba002d4db8970c77047499 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Sat, 16 Sep 2023 19:39:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20redis=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E5=81=9C=E6=AD=A2=E5=BE=AA=E7=8E=AF=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/redis/redis.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/redis/redis.go b/lib/core/redis/redis.go index 69fc3579..d4597780 100644 --- a/lib/core/redis/redis.go +++ b/lib/core/redis/redis.go @@ -46,9 +46,10 @@ func Connect() { // 测试数据库连接 pong, err := rdb.Ping(ctx).Result() if err != nil { - log.Fatalf("failed error ping redis %s is %v", client["host"], err) + log.Fatalf("failed error ping redis %s %d is %v", client["host"], client["db"], err) + continue } - log.Infof("redis %s %s connection is successful.", client["host"], pong) + log.Infof("redis %s %d %s connection is successful.", client["host"], client["db"], pong) rdbMap[k] = rdb } }