1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-19 07:22:17 +03:00
go-redis/export_test.go
Vladimir Mihailenco 4edc7a059c Fix race in tests.
2016-03-09 14:36:14 +02:00

38 lines
465 B
Go

package redis
import (
"net"
"sync"
"time"
)
func (c *baseClient) Pool() pool {
return c.connPool
}
func (c *PubSub) Pool() pool {
return c.base.connPool
}
var NewConnDialer = newConnDialer
func (cn *conn) SetNetConn(netcn net.Conn) {
cn.netcn = netcn
}
var timeMu sync.Mutex
func SetTime(tm time.Time) {
timeMu.Lock()
now = func() time.Time {
return tm
}
timeMu.Unlock()
}
func RestoreTime() {
timeMu.Lock()
now = time.Now
timeMu.Unlock()
}