-
Notifications
You must be signed in to change notification settings - Fork 300
Hash corrections #2173
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
Hash corrections #2173
Conversation
Running 128 parallel HEAD requests is overkill and liable to get someone banned.
lib/iris/tests/test_image_json.py
Outdated
| else: | ||
| msg = '{} is not a valid resource.'.format(uri) | ||
| exceptions.append(ValueError(msg)) | ||
| continue |
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.
what is the continue here for please, I am not convinced it is doing anything active
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.
Cut/paste leftover; will remove.
|
|
||
| # maximum number of threads for multi-threading code | ||
| MAXTHREADS = 128 | ||
| MAXTHREADS = 8 |
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.
this seems sensible, given your analysis of run times
| try: | ||
| result = requests.head(resource) | ||
| if (result.status_code == 200 and | ||
| resource.startswith('https://scitools.github.io')): |
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 agree with this logic change
6b8ea39 to
87d1cf8
Compare
|
neat improvements; thank you @QuLogic |
This is a followup to my comments on #2162. The number of threads does not need to be so high, and if the hostname is invalid, we should not even bother to make the request.