link_checking: prevent rate-limiting#1421
Merged
Merged
Conversation
Fix for getzola#1056. - assign all links for a domain to the same thread - reduce number of threads from 32 to 8 - add sleep between HTTP calls
angristan
commented
Mar 30, 2021
angristan
commented
Mar 30, 2021
angristan
commented
Mar 30, 2021
angristan
commented
Mar 30, 2021
angristan
commented
Mar 30, 2021
hugomd
reviewed
Mar 30, 2021
Keats
requested changes
Mar 30, 2021
a98b4d3 to
a7f862c
Compare
7f98368 to
cd2d021
Compare
Keats
approved these changes
Apr 7, 2021
Collaborator
Keats
left a comment
There was a problem hiding this comment.
LGTM, just need to remove the println
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #1056.
Demo
Considering there is 500 links to check, it takes about 2.7s per link. Out of these 500 links there are 150
github.comlinks, that's why we see all the github links at the end, since this is the last thread running. I didn't get any429 Too Many Requestsusing this patch.This is my first time using Rust 🦀, so I'm not familiar with the idiomatic way of doing things. I had a hard times with iterators, but it looks like I ended up with something that works! I look forward to some review so I can see what can be improved. 🙏 I added a few comments on things that I'm not sure how to handle.