Use aiohttp.ClientTimeout for timeout (#122458)

This commit is contained in:
Marc Mueller 2024-07-23 15:20:04 +02:00 committed by GitHub
parent 545514c5cd
commit 156a2427ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 8 deletions

View file

@ -94,7 +94,7 @@ async def fetch_redirect_uris(hass: HomeAssistant, url: str) -> list[str]:
try:
async with (
aiohttp.ClientSession() as session,
session.get(url, timeout=5) as resp,
session.get(url, timeout=aiohttp.ClientTimeout(total=5)) as resp,
):
async for data in resp.content.iter_chunked(1024):
parser.feed(data.decode())