Skip to content

Describe --max-pages as a queue budget, not a render count - #85

Merged
tamnd merged 1 commit into
mainfrom
docs/max-pages-budget
Aug 10, 2026
Merged

Describe --max-pages as a queue budget, not a render count#85
tamnd merged 1 commit into
mainfrom
docs/max-pages-budget

Conversation

@tamnd

@tamnd tamnd commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Follow-up to #76, which corrected the --max-pages docs but still described the cap as a limit on render attempts.

The cap is applied in enqueuePage against c.enqueued (clone/cloner.go:495), so the budget is spent when a URL is queued, not when it renders. A URL can take its slot and never reach the renderer at all:

  • robots.txt disallows it, which is checked after dequeue and then marked done
  • it turns out not to be HTML, so ErrNotHTML hands it to the asset downloader
  • the context cancels before the job reaches pageJobs

So --max-pages 100 on a site with 40 disallowed URLs renders 60 pages, not 100. "Attempt at most N page renders" predicts 100.

This rewords the flag help, the README and cli.md tables, the scoping guide, and the changelog, and puts the explanation on Config.MaxPages so the next person to read the struct does not have to rediscover it. It also documents a good undocumented behaviour: front.offer records a page before the budget check, so pages discovered past the cap persist to state.json and a rerun with a higher cap continues.

Docs and comments only, no behaviour change.

The cap is applied in enqueuePage against c.enqueued, so the budget is
spent when a URL is queued rather than when it renders. A page that fails,
that robots.txt disallows (checked after dequeue), or that turns out not to
be HTML has already taken its slot, so a run can save fewer pages than
asked for. The guide now also documents that pages discovered past the cap
are still persisted to state.json, so raising the cap and rerunning
continues instead of starting over.

Follow-up to #76.
@tamnd
tamnd merged commit 62ae4e0 into main Aug 10, 2026
9 checks passed
@tamnd
tamnd deleted the docs/max-pages-budget branch August 10, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant