mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Enable keep-alive by default
This commit is contained in:
@ -85,7 +85,10 @@ func (opt *Options) init() {
|
||||
}
|
||||
if opt.Dialer == nil {
|
||||
opt.Dialer = func() (net.Conn, error) {
|
||||
netDialer := &net.Dialer{Timeout: opt.DialTimeout}
|
||||
netDialer := &net.Dialer{
|
||||
Timeout: opt.DialTimeout,
|
||||
KeepAlive: 5 * time.Minute,
|
||||
}
|
||||
if opt.TLSConfig == nil {
|
||||
return netDialer.Dial(opt.Network, opt.Addr)
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user