Describe --max-pages as a queue budget, not a render count - #85
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #76, which corrected the
--max-pagesdocs but still described the cap as a limit on render attempts.The cap is applied in
enqueuePageagainstc.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.txtdisallows it, which is checked after dequeue and then marked doneErrNotHTMLhands it to the asset downloaderpageJobsSo
--max-pages 100on 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.MaxPagesso the next person to read the struct does not have to rediscover it. It also documents a good undocumented behaviour:front.offerrecords a page before the budget check, so pages discovered past the cap persist tostate.jsonand a rerun with a higher cap continues.Docs and comments only, no behaviour change.