Hass.io: Disable timeout when updating OS/supervisor/hass (#8447)
This commit is contained in:
parent
effbb3bd4c
commit
effb9e9d23
1 changed files with 4 additions and 12 deletions
|
@ -26,17 +26,7 @@ DOMAIN = 'hassio'
|
||||||
DEPENDENCIES = ['http']
|
DEPENDENCIES = ['http']
|
||||||
|
|
||||||
TIMEOUT = 10
|
TIMEOUT = 10
|
||||||
|
NO_TIMEOUT = set(['homeassistant/update', 'host/update', 'supervisor/update'])
|
||||||
ADDON_REST_COMMANDS = {
|
|
||||||
'install': ['POST'],
|
|
||||||
'uninstall': ['POST'],
|
|
||||||
'start': ['POST'],
|
|
||||||
'stop': ['POST'],
|
|
||||||
'update': ['POST'],
|
|
||||||
'options': ['POST'],
|
|
||||||
'info': ['GET'],
|
|
||||||
'logs': ['GET'],
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
|
@ -107,6 +97,8 @@ class HassIO(object):
|
||||||
|
|
||||||
This method is a coroutine.
|
This method is a coroutine.
|
||||||
"""
|
"""
|
||||||
|
read_timeout = 0 if path in NO_TIMEOUT else 300
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = None
|
data = None
|
||||||
headers = None
|
headers = None
|
||||||
|
@ -120,7 +112,7 @@ class HassIO(object):
|
||||||
method = getattr(self.websession, request.method.lower())
|
method = getattr(self.websession, request.method.lower())
|
||||||
client = yield from method(
|
client = yield from method(
|
||||||
"http://{}/{}".format(self._ip, path), data=data,
|
"http://{}/{}".format(self._ip, path), data=data,
|
||||||
headers=headers
|
headers=headers, timeout=read_timeout
|
||||||
)
|
)
|
||||||
|
|
||||||
return client
|
return client
|
||||||
|
|
Loading…
Add table
Reference in a new issue