mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-03-17 21:32:56 +01:00
release sub.Events lock when subscription is canceled.
This commit is contained in:
parent
61cd3130fd
commit
c5bf5892c3
@ -70,7 +70,10 @@ func (sub *Subscription) start() {
|
||||
go func() {
|
||||
mu.Lock()
|
||||
if sub.live.Load() {
|
||||
sub.Events <- event
|
||||
select {
|
||||
case sub.Events <- event:
|
||||
case <-sub.Context.Done():
|
||||
}
|
||||
}
|
||||
mu.Unlock()
|
||||
}()
|
||||
|
Loading…
x
Reference in New Issue
Block a user