Skip to content

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