fix(commands:iplocalise|Network): fix map timeout

This commit is contained in:
Romain J 2021-05-16 18:03:33 +02:00
parent 82b8fb9814
commit 3d8ea556d5

View file

@ -230,7 +230,9 @@ async def get_map_bytes(apikey: str, latlon: str) -> Optional[io.BytesIO]:
url = url.format(lonlat=lonlat, apikey=apikey) url = url.format(lonlat=lonlat, apikey=apikey)
try: 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: async with cs.get(url) as s:
if s.status != 200: if s.status != 200:
return None return None