mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
HA: Fix notificationListeners not getting messages in order
This commit is contained in:
parent
8f3450512a
commit
63f01d202b
1 changed files with 2 additions and 4 deletions
6
ha/ha.go
6
ha/ha.go
|
|
@ -263,7 +263,7 @@ func (h *HA) runEventListener() {
|
|||
}
|
||||
|
||||
func (h *HA) RegisterNotificationListener(listenerType string) chan int {
|
||||
ch := make(chan int)
|
||||
ch := make(chan int, 10)
|
||||
h.notificationListenersMutex.Lock()
|
||||
h.notificationListeners[listenerType] = append(h.notificationListeners[listenerType], ch)
|
||||
h.notificationListenersMutex.Unlock()
|
||||
|
|
@ -274,9 +274,7 @@ func (h *HA) notifyNotificationListener(listenerType string, msg int) {
|
|||
for t, chs := range h.notificationListeners {
|
||||
if t == listenerType || listenerType == "*" {
|
||||
for _, c := range chs {
|
||||
go func(ch chan int) {
|
||||
ch <- msg
|
||||
}(c)
|
||||
c <- msg
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue