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

Count Zyte API requests from the downloader middleware itself #228

Merged
merged 2 commits into from
Oct 22, 2024

Conversation

Gallaecio
Copy link
Contributor

No description provided.

)
total_requests = zapi_req_count + download_req_count
return total_requests >= self._max_requests
self.slot_request(request, spider, force=True)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved after the count to skip this part if the request is going to be ignored anyway.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.85%. Comparing base (b08c735) to head (ef933ac).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
- Coverage   97.86%   97.85%   -0.01%     
==========================================
  Files          14       14              
  Lines        1590     1585       -5     
  Branches      294      293       -1     
==========================================
- Hits         1556     1551       -5     
  Misses         14       14              
  Partials       20       20              
Files with missing lines Coverage Δ
scrapy_zyte_api/_middlewares.py 97.60% <100.00%> (-0.10%) ⬇️

@Gallaecio Gallaecio merged commit 98fb441 into scrapy-plugins:main Oct 22, 2024
19 checks passed
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.

2 participants