From 46527c872dd979fa8c277cb53f842d718625bc2f Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Tue, 28 Apr 2015 17:00:10 +0300 Subject: [PATCH] cluster: don't reset clients when slots are changed. --- cluster.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cluster.go b/cluster.go index 178db178..b8adedc7 100644 --- a/cluster.go +++ b/cluster.go @@ -35,7 +35,6 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient { } client.commandable.process = client.process client.reloadIfDue() - go client.reaper(time.NewTicker(5 * time.Minute)) return client } @@ -44,6 +43,7 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient { func (c *ClusterClient) Close() error { // TODO: close should make client unusable c.setSlots(nil) + c.resetClients() return nil } @@ -179,7 +179,6 @@ func (c *ClusterClient) resetClients() (err error) { func (c *ClusterClient) setSlots(slots []ClusterSlotInfo) { c.slotsMx.Lock() - c.resetClients() seen := make(map[string]struct{}) for _, addr := range c.addrs { seen[addr] = struct{}{}