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
Commit b390f63
Browse filesBrowse the repository at this point in the historyBrowse files
feat(request-loaders)!: Add sitemap timeout and retries options (#2519)
### Description
`SitemapRequestLoader` takes `sitemap_timeout` and `sitemap_retries`.
`sitemap_timeout` limits each attempt to fetch a sitemap, including
reading its body, and defaults to 30 seconds. Reading pauses while the
loader's buffer is full, so a slow crawl of a large sitemap may need a
higher timeout. `None` disables it.
`sitemap_retries` counts the retries after the first attempt and
defaults to 3, so a sitemap that keeps failing is now fetched up to 4
times instead of 3.
### Testing
- Unit tests that the timeout and the number of retries reach the
sitemap fetch, also with the timeout disabled. The tests that count
attempts now expect one more attempt.
*✍️ Drafted by Claude Code*
Copy file name to clipboardExpand all lines: docs/06_upgrading/upgrading_to_v2.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -650,6 +650,10 @@ class MyHttpClient(HttpClient):
650
650
651
651
`SitemapRequestLoader.fetch_next_request` skips a URL while its request is still in progress, for example when another sitemap lists it too. In v1, it returned a request for the URL again, and `get_total_count` counted the URL twice.
652
652
653
+
## Sitemap fetch retries
654
+
655
+
`SitemapRequestLoader` now fetches a sitemap that keeps failing up to 4 times instead of 3. Its `sitemap_retries` counts the retries after the first attempt, as in Crawlee JS. To keep 3 attempts, pass `sitemap_retries=2`.
656
+
653
657
## Crawlers manage only what they create
654
658
655
659
A crawler now enters and exits only the objects it creates, the same as Crawlee JS. An object you pass is yours to enter and exit. The `Statistics` and the event managers are the exceptions, since the crawler enters them on every run. You can enter an event manager yourself as well. In v1, the crawler entered a passed object that wasn't active yet and exited it when its run finished, even while another crawler still used it.
0 commit comments