summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-26 22:04:48 -0400
committerdemo <demo@antix1>2026-05-26 22:05:21 -0400
commit5898a16cf4b9dc2f0eef2bf81d429b5aca7005fc (patch)
tree761688648e0bbfe3eeef64b79da78b2baef0010f
parentdec73ce1d6d0abf31861cae9dd7965d86dc7496f (diff)
feat: add some prints to prove we need to select on Done()
-rw-r--r--workers.go4
1 files changed, 2 insertions, 2 deletions
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 }()
}