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 timeouts to all remote requests #43

Merged
merged 2 commits into from
May 17, 2017

Conversation

soar
Copy link
Contributor

@soar soar commented Apr 18, 2017

Today I faced problem, when thread became unaccessible because of long answer from Docker Hub registry. I think, all requests to remote APIs should have reasonable timeouts. For me - it's about 10 seconds. If API is not responding - I prefer to get exception and not wait for a lifetime. But Python Requests library has no timeout by default.

So I've added optional parameter, which can be used like:

client = DockerRegistryClient('https://index.docker.io', api_version=1, api_timeout=10)

where api_timeout could be float or tuple according to requests docs.

@jkaldon jkaldon merged commit 4cb4da0 into yodle:master May 17, 2017
@soar soar deleted the feature/add-timeout branch January 26, 2023 15:16
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.

2 participants