You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cap enqueueing at max_requests_per_crawl and return a result from enqueue_links and add_requests #2306
max_requests_per_crawl only stops the crawler once enough requests have been processed (_stop_if_max_requests_count_exceeded in _basic_crawler.py). enqueue_links() and add_requests() keep writing every link to the queue, and both return None, so a handler cannot tell what was added or dropped.
JS v4 caps enqueueing at the remaining budget and reports what went over it.
Proposed solution
Feed requests to the request manager in chunks capped by the remaining budget (max_requests_per_crawl minus handled and pending). Count only requests that were actually new, so duplicates do not use up the budget. Stop once the budget is spent.
Report requests over the limit through on_skipped_request, with a new 'limit' skip reason.
enqueue_links() and add_requests() return a result with the added requests and the requests over the limit.
Activity