mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-17 20:29:07 +02:00
Fail an approval request fast when no subscriber received the prompt
This commit is contained in:
@@ -1306,7 +1306,7 @@ func (d *Status) PublishEvent(
|
||||
msg string,
|
||||
userMsg string,
|
||||
metadata map[string]string,
|
||||
) {
|
||||
) bool {
|
||||
event := &proto.SystemEvent{
|
||||
Id: uuid.New().String(),
|
||||
Severity: severity,
|
||||
@@ -1322,15 +1322,18 @@ func (d *Status) PublishEvent(
|
||||
|
||||
d.eventQueue.Add(event)
|
||||
|
||||
delivered := false
|
||||
for _, stream := range d.eventStreams {
|
||||
select {
|
||||
case stream <- event:
|
||||
delivered = true
|
||||
default:
|
||||
log.Debugf("event stream buffer full, skipping event: %v", event)
|
||||
}
|
||||
}
|
||||
|
||||
log.Debugf("event published: %v", event)
|
||||
return delivered
|
||||
}
|
||||
|
||||
// SubscribeToEvents returns a new event subscription
|
||||
|
||||
Reference in New Issue
Block a user