mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-23 00:56:29 +00:00
Updater check response code (#2766)
* Updater check response code * use newstyle timeout
This commit is contained in:
parent
16ce4296a2
commit
c43acd50f4
@ -189,7 +189,13 @@ class Updater(FileConfiguration, CoreSysAttributes):
|
|||||||
# Get data
|
# Get data
|
||||||
try:
|
try:
|
||||||
_LOGGER.info("Fetching update data from %s", url)
|
_LOGGER.info("Fetching update data from %s", url)
|
||||||
async with self.sys_websession.get(url, timeout=10) as request:
|
timeout = aiohttp.ClientTimeout(total=10)
|
||||||
|
async with self.sys_websession.get(url, timeout=timeout) as request:
|
||||||
|
if request.status != 200:
|
||||||
|
raise UpdaterError(
|
||||||
|
f"Fetching version from {url} response with {request.status}",
|
||||||
|
_LOGGER.warning,
|
||||||
|
)
|
||||||
data = await request.read()
|
data = await request.read()
|
||||||
|
|
||||||
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
|
except (aiohttp.ClientError, asyncio.TimeoutError) as err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user