Skip to content

Commit

Permalink
cluster: preload commands info
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Jun 18, 2018
1 parent e693227 commit bdf8f06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit bdf8f06

Please sign in to comment.