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
periodic_log: implemented as separate extension #5926
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5926 +/- ##
==========================================
+ Coverage 88.85% 88.91% +0.05%
==========================================
Files 162 163 +1
Lines 11445 11533 +88
Branches 1861 1877 +16
==========================================
+ Hits 10170 10255 +85
- Misses 968 969 +1
- Partials 307 309 +2
|
Implemented as separate extension. script.py
|
You might want to install pre-commit to deal with the failing CI job. |
From my side the implementation looks OK, pending docs and tests. |
scrapy/extensions/periodic_log.py
Outdated
if crawler.settings.getbool("PERIODIC_LOG_STATS") | ||
else None | ||
) | ||
except TypeError: |
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.
Shouldn't these two except clauses be combined as their code is the same?
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.
Done
Updated tests and extension. |
Interesting, looks like the telnet test needs some additional cleanup? Or does it suggest that there is some problem in the new code? |
Error on my test code fixed. |
@GeorgeA92 Could you look into the typing issues? |
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.
Looks good to me. I recommend applying the doc suggestions and the default_settings.py one, but the rest should not block this change.
Great work!
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
I just merged #6014, so you might want to merge from the latest main branch and update those utcnow() calls. |
@Gallaecio, usages of |
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.
Thanks!
The same as current version of #5830 - but implemented as separate extension. So it doesn't affect
scrapy.extensions.logstats.LogStats
and no risk of breaking it's backward compatibility.