mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Set conn.UsedAt when connection is created. Fixes #263.
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
package redis
|
||||
|
||||
import "net"
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (c *baseClient) Pool() pool {
|
||||
return c.connPool
|
||||
@ -15,3 +18,13 @@ var NewConnDialer = newConnDialer
|
||||
func (cn *conn) SetNetConn(netcn net.Conn) {
|
||||
cn.netcn = netcn
|
||||
}
|
||||
|
||||
func SetTime(tm time.Time) {
|
||||
now = func() time.Time {
|
||||
return tm
|
||||
}
|
||||
}
|
||||
|
||||
func RestoreTime() {
|
||||
now = time.Now
|
||||
}
|
||||
|
Reference in New Issue
Block a user