From 5898a16cf4b9dc2f0eef2bf81d429b5aca7005fc Mon Sep 17 00:00:00 2001 From: demo Date: Tue, 26 May 2026 22:04:48 -0400 Subject: feat: add some prints to prove we need to select on Done() --- workers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'workers.go') diff --git a/workers.go b/workers.go index f5e1329..966f330 100644 --- a/workers.go +++ b/workers.go @@ -31,12 +31,12 @@ func workers(startURL url.URL, maxConcurrency, maxURLs int) { // the urls channel (unseen links.) for i := range maxConcurrency { wg.Go(func() { - loop: for u := range urls { batch := getBatch(u) select { case <-ctx.Done(): - break loop + fmt.Printf("exiting early %d\n", i+1) + return default: go func() { worklist <- batch }() } -- cgit v1.2.3