mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
fix: handle closed channels on unsubscribe (#1995)
This commit is contained in:
parent
09b5c964cc
commit
f7aa2f6b25
@ -69,7 +69,10 @@ func (s *Subscription) Unsubscribe() {
|
||||
}
|
||||
}
|
||||
}
|
||||
close(s.Events)
|
||||
_, ok := <-s.Events
|
||||
if ok {
|
||||
close(s.Events)
|
||||
}
|
||||
}
|
||||
|
||||
func MapEventsToV1Events(events []EventReader) []*models.Event {
|
||||
|
@ -67,5 +67,8 @@ func (s *Subscription) Unsubscribe() {
|
||||
}
|
||||
}
|
||||
}
|
||||
close(s.Events)
|
||||
_, ok := <-s.Events
|
||||
if ok {
|
||||
close(s.Events)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user