1
0
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:
Vladimir Mihailenco
2016-03-04 10:03:50 +02:00
parent 7116858f67
commit 43aade818a
3 changed files with 30 additions and 9 deletions

View File

@ -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
}