From 94093807a03d295f82bcec82244f68fb10efe312 Mon Sep 17 00:00:00 2001 From: demo Date: Sat, 30 May 2026 23:55:14 -0400 Subject: feat: add code to handle maxDepth --- workers.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'workers.go') diff --git a/workers.go b/workers.go index c162954..02d7d7d 100644 --- a/workers.go +++ b/workers.go @@ -76,6 +76,14 @@ loop: break loop } + // This works similarly to the classic + // example: if we're at the max depth, + // don't tell any of the workers to + // fetch new URLs. + if maxDepth > 0 && p.depth == maxDepth { + continue + } + packets <- p } } -- cgit v1.2.3