mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
更新 gredis.go
This commit is contained in:
parent
44f857ab36
commit
3e613eebaf
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user