update
parent
78557716f6
commit
746ec6be90
|
@ -109,10 +109,10 @@ func New(config *Config) (*MyRedis, error) {
|
||||||
MinIdleConns: config.MinIdleConn,
|
MinIdleConns: config.MinIdleConn,
|
||||||
MaxConnAge: maxConnAge,
|
MaxConnAge: maxConnAge,
|
||||||
IdleTimeout: idleTimeout,
|
IdleTimeout: idleTimeout,
|
||||||
DialTimeout: time.Second * 2,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
ctx := context.Background()
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
|
||||||
|
defer cancel()
|
||||||
rd := &MyRedis{}
|
rd := &MyRedis{}
|
||||||
rd.Client = client
|
rd.Client = client
|
||||||
ping := rd.Client.Ping(ctx)
|
ping := rd.Client.Ping(ctx)
|
||||||
|
|
Loading…
Reference in New Issue