Skip to content

Commit

Permalink
cluster: don't reset clients when slots are changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Apr 28, 2015
1 parent 6313dc0 commit 46527c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}

Expand Down Expand Up @@ -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{}{}
Expand Down

0 comments on commit 46527c8

Please sign in to comment.