bump request timeout a bit
This commit is contained in:
parent
c08cfffc65
commit
b832ee42a6
1 changed files with 2 additions and 2 deletions
4
main.py
4
main.py
|
@ -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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue