Explorar el Código

fix redis bug

longyu hace 2 años
padre
commit
21e0322158
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      init_serve/redis.go

+ 7 - 0
init_serve/redis.go

@@ -2,12 +2,18 @@ package init_serve
 
 import (
 	"context"
+	"fmt"
 	"github.com/go-redis/redis/v8"
 	"hongze/fms_api/global"
 )
 
 func Redis() {
 	redisConf := global.CONFIG.Redis
+
+	fmt.Println(redisConf.Address)
+	fmt.Println(redisConf.Password)
+	fmt.Println(redisConf.Db)
+
 	client := redis.NewClient(&redis.Options{
 		Addr:     redisConf.Address,
 		Password: redisConf.Password,
@@ -15,6 +21,7 @@ func Redis() {
 		//PoolSize: 10, //连接池最大socket连接数,默认为10倍CPU数, 10 * runtime.NumCPU(暂不配置)
 	})
 	_, err := client.Ping(context.TODO()).Result()
+	fmt.Println("client.Ping", err)
 	if err != nil {
 		global.LOG.Error("redis 链接失败:", err)
 		panic("redis 链接失败:" + err.Error())