mirror of
https://github.com/redis/go-redis.git
synced 2025-07-31 05:04:23 +03:00
Use single read and write buffer where possible
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"math"
|
||||
"math/rand"
|
||||
"net"
|
||||
"runtime"
|
||||
"sort"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
@ -82,6 +83,10 @@ func (opt *ClusterOptions) init() {
|
||||
opt.ReadOnly = true
|
||||
}
|
||||
|
||||
if opt.PoolSize == 0 {
|
||||
opt.PoolSize = 5 * runtime.NumCPU()
|
||||
}
|
||||
|
||||
switch opt.ReadTimeout {
|
||||
case -1:
|
||||
opt.ReadTimeout = 0
|
||||
|
Reference in New Issue
Block a user