mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-18 19:25:13 +00:00
fix: handle closed channels on unsubscribe (#1995)
This commit is contained in:
@@ -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 {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user