Skip to content

Commit 4bf8b5a

Browse files
committed
Enable keep-alive by default
1 parent a23435c commit 4bf8b5a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Ring got new options called `HashReplicas` and `Hash`. It is recommended to set `HashReplicas = 1000` for better keys distribution between shards.
66
- Cluster client was optimized to use much less memory when reloading cluster state.
77
- PubSub.ReceiveMessage is re-worked to not use ReceiveTimeout so it does not lose data when timeout occurres. In most cases it is recommended to use PubSub.Channel instead.
8+
- Dialer.KeepAlive is set to 5 minutes by default.
89

910
## v6.12
1011

options.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ func (opt *Options) init() {
8585
}
8686
if opt.Dialer == nil {
8787
opt.Dialer = func() (net.Conn, error) {
88-
netDialer := &net.Dialer{Timeout: opt.DialTimeout}
88+
netDialer := &net.Dialer{
89+
Timeout: opt.DialTimeout,
90+
KeepAlive: 5 * time.Minute,
91+
}
8992
if opt.TLSConfig == nil {
9093
return netDialer.Dial(opt.Network, opt.Addr)
9194
} else {

0 commit comments

Comments
 (0)