From ac4571386d5dbdfd6996c963113dee4c8bd9e4f1 Mon Sep 17 00:00:00 2001 From: Dimitrij Denissenko Date: Mon, 30 Mar 2015 21:12:52 +0100 Subject: [PATCH] Naming consistency --- cluster.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cluster.go b/cluster.go index a8790f5..eb7127a 100644 --- a/cluster.go +++ b/cluster.go @@ -18,8 +18,8 @@ type ClusterClient struct { slots [][]string slotsMx sync.RWMutex // protects slots & addrs cache - conns map[string]*Client - connMx sync.Mutex // protects conns + conns map[string]*Client + connsMx sync.Mutex // protects conns opt *ClusterOptions @@ -65,7 +65,7 @@ func (c *ClusterClient) getMasterAddrBySlot(hashSlot int) string { // Returns a node's client for a given address func (c *ClusterClient) getNodeClientByAddr(addr string) *Client { - c.connMx.Lock() + c.connsMx.Lock() client, ok := c.conns[addr] if !ok { opt := c.opt.clientOptions() @@ -73,7 +73,7 @@ func (c *ClusterClient) getNodeClientByAddr(addr string) *Client { client = NewTCPClient(opt) c.conns[addr] = client } - c.connMx.Unlock() + c.connsMx.Unlock() return client } @@ -170,14 +170,14 @@ func (c *ClusterClient) reloadIfDue() (err error) { // Closes all connections and flushes slots cache func (c *ClusterClient) reset() (err error) { - c.connMx.Lock() + c.connsMx.Lock() for addr, client := range c.conns { if e := client.Close(); e != nil { err = e } delete(c.conns, addr) } - c.connMx.Unlock() + c.connsMx.Unlock() c.slots = make([][]string, hashSlots) return }