1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Extract clusterStateHolder

This commit is contained in:
Vladimir Mihailenco
2018-03-06 17:10:01 +02:00
parent f13fc5381c
commit 5e72be1cbf
2 changed files with 117 additions and 98 deletions

View File

@ -20,7 +20,7 @@ func (c *PubSub) ReceiveMessageTimeout(timeout time.Duration) (*Message, error)
}
func (c *ClusterClient) SlotAddrs(slot int) []string {
state, err := c.state()
state, err := c.state.Get()
if err != nil {
panic(err)
}
@ -34,7 +34,7 @@ func (c *ClusterClient) SlotAddrs(slot int) []string {
// SwapSlot swaps a slot's master/slave address for testing MOVED redirects.
func (c *ClusterClient) SwapSlotNodes(slot int) {
state, err := c.state()
state, err := c.state.Get()
if err != nil {
panic(err)
}