mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
更新 gredis.go
This commit is contained in:
@ -69,6 +69,11 @@ func New(config Config) *Redis {
|
||||
}
|
||||
return c, nil
|
||||
},
|
||||
// 用来测试连接是否可用
|
||||
TestOnBorrow: func(c redis.Conn, t time.Time) error {
|
||||
_, err := c.Do("PING")
|
||||
return err
|
||||
},
|
||||
}
|
||||
pools.Set(poolKey, pool)
|
||||
r.pool = pool
|
||||
|
||||
Reference in New Issue
Block a user