fix: handle closed channels on unsubscribe (#1995)

This commit is contained in:
Livio Amstutz
2021-07-09 11:33:43 +02:00
committed by GitHub
parent 09b5c964cc
commit f7aa2f6b25
2 changed files with 8 additions and 2 deletions

View File

@@ -67,5 +67,8 @@ func (s *Subscription) Unsubscribe() {
}
}
}
close(s.Events)
_, ok := <-s.Events
if ok {
close(s.Events)
}
}