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

Add a default timeout to requests #80

Closed
logut opened this issue Oct 24, 2023 · 0 comments
Closed

Add a default timeout to requests #80

logut opened this issue Oct 24, 2023 · 0 comments

Comments

@logut
Copy link

logut commented Oct 24, 2023

Is your feature request related to a problem? Please describe.
When working in an environment without direct internet access, it's often hard to recognize why the program hangs indefinitely.

Describe the solution you'd like
I would like the call to timeout after a short period.

Describe alternatives you've considered

Additional context
https://requests.readthedocs.io/en/latest/user/advanced/#timeouts
Two values for timeouts are possible with requests : connect and read. Maybe we could keep the connect to a short value like 5s and the read to longer like 30s, 60s or even None.

Timeouts can be implemented on each session.get() calls or can be implemented at the session level directly with an adapter : https://stackoverflow.com/a/62044100/6507969. This method would have the advantage of setting default timeout for other projects using PyPISession directly.

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

No branches or pull requests

1 participant