summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-27 12:39:06 -0400
committerdemo <demo@antix1>2026-05-27 12:39:56 -0400
commit29bc8d424f865f6c9187ccda510b0ad91ee228b7 (patch)
tree6d798a0c19a9f133ff6713188773346e183b2abd
parenta939f6c8ea4e7d493aa282403e1f39a12604484d (diff)
fix: make select statement block unless communication takes place
-rw-r--r--classic.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/classic.go b/classic.go
index 14bb888..653f8f8 100644
--- a/classic.go
+++ b/classic.go
@@ -55,13 +55,13 @@ loop:
sema <- struct{}{}
defer func() { <-sema }()
+ batch := getBatch(p.url)
+ ps := convertToPackets(batch, p.depth+1)
+
select {
case <-ctx.Done():
return
- default:
- batch := getBatch(p.url)
- ps := convertToPackets(batch, p.depth+1)
- worklist <- ps
+ case worklist <- ps:
}
})
}