Hass.io: Disable timeout when updating OS/supervisor/hass (#8447)

pull/8450/head
Paulus Schoutsen 2017-07-11 23:24:35 -07:00 committed by GitHub
parent effbb3bd4c
commit effb9e9d23
1 changed files with 4 additions and 12 deletions

View File

@ -26,17 +26,7 @@ DOMAIN = 'hassio'
DEPENDENCIES = ['http']
TIMEOUT = 10
ADDON_REST_COMMANDS = {
'install': ['POST'],
'uninstall': ['POST'],
'start': ['POST'],
'stop': ['POST'],
'update': ['POST'],
'options': ['POST'],
'info': ['GET'],
'logs': ['GET'],
}
NO_TIMEOUT = set(['homeassistant/update', 'host/update', 'supervisor/update'])
@asyncio.coroutine
@ -107,6 +97,8 @@ class HassIO(object):
This method is a coroutine.
"""
read_timeout = 0 if path in NO_TIMEOUT else 300
try:
data = None
headers = None
@ -120,7 +112,7 @@ class HassIO(object):
method = getattr(self.websession, request.method.lower())
client = yield from method(
"http://{}/{}".format(self._ip, path), data=data,
headers=headers
headers=headers, timeout=read_timeout
)
return client