mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
dry sub.unsub() on context cancelation.
This commit is contained in:
parent
e9ad77c822
commit
46e724b8d5
@ -86,11 +86,7 @@ func (sub *Subscription) Fire(ctx context.Context) error {
|
||||
go func() {
|
||||
<-sub.Relay.ConnectionContext.Done()
|
||||
|
||||
// this will close the Events channel,
|
||||
// which can be used by an external reader to learn the subscription has stopped
|
||||
sub.Unsub()
|
||||
|
||||
// we also cancel the context
|
||||
// cancel the context -- this will cause the other context cancelation cause above to be called
|
||||
cancel()
|
||||
}()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user