Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add request count to max requests close reason #154

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BurnzZ
Copy link
Member

@BurnzZ BurnzZ commented Dec 18, 2023

When looking at the list of spider jobs in Scrapy Cloud, there's a column dictating the spider's close_reason message. Some users have raised that it's not apparently clear from this view about the max request that was set.

What do you think about including the set number of max requests to the spider close_reason message?

image

Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Merging #154 (39ddbd8) into main (0536f42) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #154   +/-   ##
=======================================
  Coverage   98.64%   98.64%           
=======================================
  Files          11       11           
  Lines         812      812           
=======================================
  Hits          801      801           
  Misses         11       11           
Files Coverage Δ
scrapy_zyte_api/_middlewares.py 100.00% <100.00%> (ø)

@Gallaecio
Copy link
Contributor

I am not sure about it, but not against it either.

@@ -108,7 +108,9 @@ def process_request(self, request, spider):
slot.delay = 0

if self._max_requests_reached(downloader):
self._crawler.engine.close_spider(spider, "closespider_max_zapi_requests")
self._crawler.engine.close_spider(
spider, f"closespider_max_{self._max_requests}_zapi_requests"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to have the close reasons static, so that they are not unique each run. If we need any additional information, then stats look like a better place.

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.

3 participants