mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-25 07:32:19 +00:00
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
|
||||
}
|
||||
|
||||
p.peerLock.RLock()
|
||||
defer p.peerLock.RUnlock()
|
||||
p.peerLock.Lock()
|
||||
defer p.peerLock.Unlock()
|
||||
|
||||
now := time.Now()
|
||||
for _, peerAddr := range peers {
|
||||
|
Loading…
Reference in New Issue
Block a user