From 3d8ea556d5c3e5d5441d07dcc08e7bb1a2c51800 Mon Sep 17 00:00:00 2001 From: Romain J Date: Sun, 16 May 2021 18:03:33 +0200 Subject: [PATCH] fix(commands:iplocalise|Network): fix map timeout --- tuxbot/cogs/Network/functions/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tuxbot/cogs/Network/functions/utils.py b/tuxbot/cogs/Network/functions/utils.py index dee7cb5..fe146de 100644 --- a/tuxbot/cogs/Network/functions/utils.py +++ b/tuxbot/cogs/Network/functions/utils.py @@ -230,7 +230,9 @@ async def get_map_bytes(apikey: str, latlon: str) -> Optional[io.BytesIO]: url = url.format(lonlat=lonlat, apikey=apikey) try: - async with aiohttp.ClientSession() as cs: + async with aiohttp.ClientSession( + timeout=aiohttp.ClientTimeout(total=5) + ) as cs: async with cs.get(url) as s: if s.status != 200: return None