Don't leak channels

This commit is contained in:
Neil Alexander 2021-01-06 14:38:31 +00:00
parent cbaeff6096
commit 6da5ebfadf
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 2 additions and 0 deletions

View file

@ -75,6 +75,7 @@ func (p *StreamProvider) NotifyAfter(
case <-ctx.Done(): case <-ctx.Done():
// The context has expired, so there's no point // The context has expired, so there's no point
// in continuing to wait for the update. // in continuing to wait for the update.
close(ch)
return return
default: default:
// The latest position has been advanced. Let's // The latest position has been advanced. Let's

View file

@ -75,6 +75,7 @@ func (p *StreamLogProvider) NotifyAfter(
case <-ctx.Done(): case <-ctx.Done():
// The context has expired, so there's no point // The context has expired, so there's no point
// in continuing to wait for the update. // in continuing to wait for the update.
close(ch)
return return
default: default:
// The latest position has been advanced. Let's // The latest position has been advanced. Let's