mirror of
https://github.com/nbd-wtf/go-nostr.git
synced 2025-06-13 18:31:26 +02: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() {
|
go func() {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
if sub.live.Load() {
|
if sub.live.Load() {
|
||||||
sub.Events <- event
|
select {
|
||||||
|
case sub.Events <- event:
|
||||||
|
case <-sub.Context.Done():
|
||||||
|
}
|
||||||
}
|
}
|
||||||
mu.Unlock()
|
mu.Unlock()
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user