cluster: change lock from Read lock to Write Lock since function modifies the struct... (#2109)
Signed-off-by: John Smith <megman5576@gmail.com>
This commit is contained in:
parent
26cc96a787
commit
f76fec1fd9
|
@ -260,8 +260,8 @@ func (p *Peer) setInitialFailed(peers []string, myAddr string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.peerLock.RLock()
|
p.peerLock.Lock()
|
||||||
defer p.peerLock.RUnlock()
|
defer p.peerLock.Unlock()
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for _, peerAddr := range peers {
|
for _, peerAddr := range peers {
|
||||||
|
|
Loading…
Reference in New Issue