From b832ee42a6de1823433b678b6cb53c4f3e0a56f2 Mon Sep 17 00:00:00 2001 From: Matthew Ryan Dillon Date: Sun, 20 Jul 2025 07:50:03 -0400 Subject: [PATCH] bump request timeout a bit --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index b9a42d9..8767d3b 100644 --- a/main.py +++ b/main.py @@ -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()