Skip to content

Commit

Permalink
Merge pull request #12 from Gallaecio/max-request-docs
Browse files Browse the repository at this point in the history
Clarify how max requests work for error responses
  • Loading branch information
kmike committed Nov 8, 2023
2 parents 01c236b + e6828b8 commit ca4dfb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/test_ecommerce.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,13 @@ def test_metadata():
"anyOf": [{"type": "integer"}, {"type": "null"}],
"default": None,
"title": "Max Requests",
"description": "The max number of Zyte API requests allowed for the crawl.",
"description": (
"The maximum number of Zyte API requests allowed for the crawl.\n"
"\n"
"Requests with error responses that cannot be retried or exceed "
"their retry limit also count here, but they incur in no costs "
"and do not increase the request count in Scrapy Cloud."
),
"widget": "request-limit",
},
"url": {
Expand Down
8 changes: 7 additions & 1 deletion zyte_spider_templates/spiders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ class BaseSpiderParams(BaseModel):
},
)
max_requests: Optional[int] = Field(
description="The max number of Zyte API requests allowed for the crawl.",
description=(
"The maximum number of Zyte API requests allowed for the crawl.\n"
"\n"
"Requests with error responses that cannot be retried or exceed "
"their retry limit also count here, but they incur in no costs "
"and do not increase the request count in Scrapy Cloud."
),
default=None,
json_schema_extra={
"widget": "request-limit",
Expand Down

0 comments on commit ca4dfb9

Please sign in to comment.