subscription.EndOfStoredEvents to have a capacity of 1 so it never gets deadlocked.

This commit is contained in:
fiatjaf
2024-01-28 14:34:01 -03:00
parent 58ff5f6716
commit 09ea5d5758

View File

@@ -385,7 +385,7 @@ func (r *Relay) PrepareSubscription(ctx context.Context, filters Filters, opts .
cancel: cancel, cancel: cancel,
counter: int(current), counter: int(current),
Events: make(chan *Event), Events: make(chan *Event),
EndOfStoredEvents: make(chan struct{}), EndOfStoredEvents: make(chan struct{}, 1),
ClosedReason: make(chan string, 1), ClosedReason: make(chan string, 1),
Filters: filters, Filters: filters,
} }