bump request timeout a bit #5

Merged
thermokarst merged 1 commit from thermokarst_jj_oqvsrwlxzwsp into main 2025-07-20 11:51:22 +00:00

View file

@ -108,7 +108,7 @@ async def fetch_pollen(zipcode):
"Referer": url,
"Cookie": f"geo={zipcode}",
}
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=10.0) as client:
response = await client.get(url, headers=headers)
response.raise_for_status()
data = response.json()
@ -140,7 +140,7 @@ async def fetch_weather(lat, lon, weather_api_key):
return weather_cache[cache_key]
url = f"https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&appid={weather_api_key}&units=imperial"
async with httpx.AsyncClient() as client:
async with httpx.AsyncClient(timeout=10.0) as client:
response = await client.get(url)
response.raise_for_status()
data = response.json()