Merge pull request #792 from go-redis/fix/pipeline-tests

cluster: preload commands info
This commit is contained in:
Vladimir Mihailenco 2018-06-18 13:06:36 +03:00 committed by GitHub
commit be87bf7f2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -653,6 +653,8 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient {
c.init()
_, _ = c.state.Reload()
_, _ = c.cmdsInfoCache.Get()
if opt.IdleCheckFrequency > 0 {
go c.reaper(opt.IdleCheckFrequency)
}

View File

@ -853,8 +853,8 @@ var _ = Describe("ClusterClient timeout", func() {
Context("read/write timeout", func() {
BeforeEach(func() {
opt := redisClusterOptions()
opt.ReadTimeout = 300 * time.Millisecond
opt.WriteTimeout = 300 * time.Millisecond
opt.ReadTimeout = 250 * time.Millisecond
opt.WriteTimeout = 250 * time.Millisecond
opt.MaxRedirects = 1
client = cluster.clusterClient(opt)