From 7efdacd0288a94889c8a9018dc7d3f5b3ab1497b Mon Sep 17 00:00:00 2001 From: Matt Jaffee Date: Tue, 17 Jul 2018 14:34:36 -0500 Subject: [PATCH] rename setState to unprotected --- cluster.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cluster.go b/cluster.go index 06beebe9a..16ff2fec2 100644 --- a/cluster.go +++ b/cluster.go @@ -381,11 +381,11 @@ func (c *cluster) State() string { func (c *cluster) SetState(state string) { c.mu.Lock() - c.setState(state) + c.unprotectedSetState(state) c.mu.Unlock() } -func (c *cluster) setState(state string) { +func (c *cluster) unprotectedSetState(state string) { // Ignore cases where the state hasn't changed. if state == c.state { return @@ -964,7 +964,7 @@ func (c *cluster) handleNodeAction(nodeAction nodeAction) error { } func (c *cluster) unprotectedSetStateAndBroadcast(state string) error { - c.setState(state) + c.unprotectedSetState(state) if c.Static { return nil } @@ -1728,7 +1728,7 @@ func (c *cluster) mergeClusterStatus(cs *ClusterStatus) error { } } - c.setState(cs.State) + c.unprotectedSetState(cs.State) c.markAsJoined()