summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--workers.go8
1 files changed, 8 insertions, 0 deletions
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
}
}