From bea3bad15ebae9ea6fb7e37b89145efeedf1aaf5 Mon Sep 17 00:00:00 2001 From: Alejandro Durante Date: Sun, 20 Oct 2024 11:23:49 -0300 Subject: [PATCH] Fix subpool tests --- internal/dispatcher/dispatcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/dispatcher/dispatcher.go b/internal/dispatcher/dispatcher.go index d1a3409..83ec26c 100644 --- a/internal/dispatcher/dispatcher.go +++ b/internal/dispatcher/dispatcher.go @@ -121,7 +121,7 @@ func (d *Dispatcher[T]) run(ctx context.Context) { batch = batch[:0] } - if !ok { + if !ok || d.closed.Load() { // Channel was closed, read all remaining elements and exit return }