fix:修改redis包,使用推荐的v8

This commit is contained in:
songzhibin97
2021-07-12 19:23:56 +08:00
parent ff506730de
commit 07ec0841c9
4 changed files with 11 additions and 11 deletions

View File

@@ -1,8 +1,10 @@
package initialize
import (
"context"
"gin-vue-admin/global"
"github.com/go-redis/redis"
"github.com/go-redis/redis/v8"
"go.uber.org/zap"
)
@@ -13,7 +15,7 @@ func Redis() {
Password: redisCfg.Password, // no password set
DB: redisCfg.DB, // use default DB
})
pong, err := client.Ping().Result()
pong, err := client.Ping(context.Background()).Result()
if err != nil {
global.GVA_LOG.Error("redis connect ping failed, err:", zap.Any("err", err))
} else {