fix potential subscription leaking bug with MaxWaitForEOSE never being effective.

This commit is contained in:
fiatjaf
2026-02-27 06:47:14 -03:00
parent c31b92707b
commit 195cb944e2
3 changed files with 26 additions and 17 deletions
+2
View File
@@ -423,6 +423,7 @@ func (r *Relay) PrepareSubscription(ctx context.Context, filter Filter, opts Sub
ClosedReason: make(chan string, 1),
Filter: filter,
match: filter.Matches,
eoseTimedOut: make(chan struct{}),
}
sub.checkDuplicate = opts.CheckDuplicate
@@ -447,6 +448,7 @@ func (r *Relay) PrepareSubscription(ctx context.Context, filter Filter, opts Sub
go func() {
time.Sleep(opts.MaxWaitForEOSE)
sub.eoseTimedOut <- struct{}{}
sub.dispatchEose()
}()
}