fix: redis连接失败停止循环连接
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user