simplify subscription closing.

This commit is contained in:
fiatjaf
2023-08-22 10:41:58 -03:00
parent cd86ee2514
commit 446b104990
2 changed files with 22 additions and 25 deletions

View File

@ -482,15 +482,14 @@ func (r *Relay) PrepareSubscription(ctx context.Context, filters Filters, opts .
ctx, cancel := context.WithCancel(ctx)
sub := &Subscription{
Relay: r,
Context: ctx,
cancel: cancel,
counter: int(current),
Events: make(chan *Event),
events: make(chan *Event),
EndOfStoredEvents: make(chan struct{}),
Filters: filters,
closeEventsChannel: make(chan struct{}),
Relay: r,
Context: ctx,
cancel: cancel,
counter: int(current),
Events: make(chan *Event),
events: make(chan *Event),
EndOfStoredEvents: make(chan struct{}),
Filters: filters,
}
for _, opt := range opts {