diff --git a/ariston/ariston_api.py b/ariston/ariston_api.py index 465e078..046a158 100644 --- a/ariston/ariston_api.py +++ b/ariston/ariston_api.py @@ -944,7 +944,11 @@ async def __async_request( params, ) - async with aiohttp.ClientSession() as session: + # Apply an explicit total timeout so a stalled request fails fast + # instead of relying on aiohttp's 5 minute default. This mirrors the + # 30 second timeout used by the synchronous `requests` path. + timeout = aiohttp.ClientTimeout(total=30) + async with aiohttp.ClientSession(timeout=timeout) as session: response = await session.request( method, path, params=params, json=body, headers=headers )