mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-28 00:30:44 +00:00
Remove data race from alert subscription
This commit is contained in:
parent
913c17c254
commit
2d8829d751
@ -216,7 +216,9 @@ func (a *SQLAlerts) Subscribe() AlertIterator {
|
||||
i := a.next
|
||||
a.next++
|
||||
|
||||
a.mtx.Lock()
|
||||
a.listeners[i] = ch
|
||||
a.mtx.Unlock()
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
|
Loading…
Reference in New Issue
Block a user