feat: add MustNewRedis (#2824)
* feat: add MustNewRedis * feat: add MustNewRedis * feat: add MustNewRedis * x * x * fix ut * x * x * x * x * x
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/zeromicro/go-zero/core/load"
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"github.com/zeromicro/go-zero/core/stat"
|
||||
"github.com/zeromicro/go-zero/core/stores/redis"
|
||||
"github.com/zeromicro/go-zero/zrpc/internal"
|
||||
"github.com/zeromicro/go-zero/zrpc/internal/auth"
|
||||
"github.com/zeromicro/go-zero/zrpc/internal/serverinterceptors"
|
||||
@@ -120,7 +121,12 @@ func setupInterceptors(server internal.Server, c RpcServerConf, metrics *stat.Me
|
||||
}
|
||||
|
||||
if c.Auth {
|
||||
authenticator, err := auth.NewAuthenticator(c.Redis.NewRedis(), c.Redis.Key, c.StrictControl)
|
||||
rds, err := redis.NewRedis(c.Redis.RedisConf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
authenticator, err := auth.NewAuthenticator(rds, c.Redis.Key, c.StrictControl)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user