mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-01 05:54:46 +03:00
Make the Docker API connection timeout configurable
This commit is contained in:
parent
487a758edf
commit
3a9ec4e4a8
@ -351,6 +351,8 @@ port_default_gateway=True
|
||||
|
||||
[docker]
|
||||
disable=False
|
||||
# Timeout for API calls (in seconds, default is 1)
|
||||
timeout=1
|
||||
# Only show specific containers (comma separeted list of container name or regular expression)
|
||||
# Comment this line to display all containers (default configuration)
|
||||
#show=telegraf
|
||||
|
@ -137,7 +137,7 @@ class Plugin(GlancesPlugin):
|
||||
def connect(self):
|
||||
"""Connect to the Docker server."""
|
||||
try:
|
||||
ret = docker.from_env()
|
||||
ret = docker.from_env(timeout=int(self.get_conf_value('timeout', '1')))
|
||||
except Exception as e:
|
||||
logger.error("docker plugin - Can not connect to Docker ({})".format(e))
|
||||
ret = None
|
||||
|
Loading…
Reference in New Issue
Block a user