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

Adding a timeout parameter to the HTTP request #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jaintapauljp
Copy link

In file: main.py, method: get_weather, a request is made without a timeout parameter. The requests.get method in Python does not use any default timeout value and should be explicitly set. Otherwise, if the recipient server is unavailable to service the request, the application making the request may stall indefinitely.

What should be the timeout value? A good practice is to set it under 500ms. This PR proposes the value to be 400ms. However, this may vary depending on the use case. More information is available in: https://docs.python-requests.org/en/latest/user/advanced/#timeouts

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.

1 participant