From bdf8f069047c9db9845652e85cca2dfd1b84e93f Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Mon, 18 Jun 2018 12:55:26 +0300 Subject: [PATCH] cluster: preload commands info --- cluster.go | 2 ++ cluster_test.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cluster.go b/cluster.go index 9aa51fb9..a8115b4f 100644 --- a/cluster.go +++ b/cluster.go @@ -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) } diff --git a/cluster_test.go b/cluster_test.go index db0728d7..80b4d02f 100644 --- a/cluster_test.go +++ b/cluster_test.go @@ -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)