docker / docker-py

A Python library for the Docker Engine API
https://docker-py.readthedocs.io/
Apache License 2.0
6.81k stars 1.67k forks source link

Support per-call timeouts in APIClient #3274

Open kasium opened 3 months ago

kasium commented 3 months ago

As for now, I can only set the timeout in the client during construction. However, if a certain call needs another timeout, it's not possible to change it:

from docker import APIClient

client = APIClient(timeout=10)
client.inspect_container("container_id")
# wish: client.inspect_container("container_id", timeout=60)
kasium commented 3 months ago

Of course it's not as easy as it sounds, since the timeout is also given to requests, urllib3 and custom HTTP adapters