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
[get_retry_request] Adding ability to set log level #5625
base: master
Are you sure you want to change the base?
[get_retry_request] Adding ability to set log level #5625
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5625 +/- ##
==========================================
+ Coverage 88.66% 88.69% +0.03%
==========================================
Files 162 162
Lines 10962 10969 +7
Branches 1894 1796 -98
==========================================
+ Hits 9719 9729 +10
+ Misses 963 960 -3
Partials 280 280
|
How would one use this? By subclassing the middleware? |
The get_retry_request function is was added last year so one could trigger retries in a callback. https://docs.scrapy.org/en/latest/news.html#scrapy-2-5-0-2021-04-06 The purpose of this issue is to add the ability to set log level when using it in a callback. There's a seperate issue #4622 for extending the middleware to then use this feature of get_retry_request, which I'm also going to work on. |
I've updated the middleware so this will fix #4622 as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, beyond my minor feedback.
Next we would need tests to cover the default function value, the ability to override through the function, and same for the setting. And a short documentation entry for the new setting.
@Gallaecio I see you previously wanted tests and docs but you've approved this now, so what should I do? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot about that 🤦
Fixes #5297, fixes #4622