bump request timeout a bit

This commit is contained in:
Matthew Ryan Dillon 2025-07-20 07:50:03 -04:00
parent c08cfffc65
commit b832ee42a6

View file

@ -108,7 +108,7 @@ async def fetch_pollen(zipcode):
"Referer": url, "Referer": url,
"Cookie": f"geo={zipcode}", "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 = await client.get(url, headers=headers)
response.raise_for_status() response.raise_for_status()
data = response.json() data = response.json()
@ -140,7 +140,7 @@ async def fetch_weather(lat, lon, weather_api_key):
return weather_cache[cache_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" 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 = await client.get(url)
response.raise_for_status() response.raise_for_status()
data = response.json() data = response.json()