diff options
| author | demo <demo@antix1> | 2026-05-30 23:55:14 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-30 23:58:19 -0400 |
| commit | 94093807a03d295f82bcec82244f68fb10efe312 (patch) | |
| tree | 3fa4b78c3f6bf4c2a65bde6e6df9d13e041ad95c | |
| parent | 1ad61d7da649dbe6603c819a20e2f705a2935bdc (diff) | |
feat: add code to handle maxDepth
| -rw-r--r-- | workers.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 } } |
