mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
cluster.Nodes() just needs a read lock
This commit is contained in:
parent
8762c2a4dc
commit
fc1de2dba9
1 changed files with 2 additions and 2 deletions
|
|
@ -609,8 +609,8 @@ func (c *cluster) addNodeBasicSorted(node *Node) bool {
|
|||
// Nodes returns a copy of the slice of nodes in the cluster. Safe for
|
||||
// concurrent use, result may be modified.
|
||||
func (c *cluster) Nodes() []*Node {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
c.mu.RLock()
|
||||
defer c.mu.RUnlock()
|
||||
ret := make([]*Node, len(c.nodes))
|
||||
copy(ret, c.nodes)
|
||||
return ret
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue