We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 43fdd5e + ffe46e6 commit d878358Copy full SHA for d878358
tokencost/constants.py
@@ -34,7 +34,8 @@ async def fetch_costs():
34
Raises:
35
Exception: If the request fails.
36
"""
37
- async with aiohttp.ClientSession(trust_env=True) as session:
+ timeout = aiohttp.ClientTimeout(total=10) # 10 seconds timeout
38
+ async with aiohttp.ClientSession(trust_env=True, timeout=timeout) as session:
39
async with session.get(PRICES_URL) as response:
40
if response.status == 200:
41
return await response.json(content_type=None)
0 commit comments