Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Nov 19, 2024
1 parent 14530d9 commit f1ff28e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quartz_solar_forecast/weather/open_meteo.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_hourly_weather(
]
url = self._build_url(latitude, longitude, start_date, end_date, variables)
try:
response = requests.get(url)
response = requests.get(url, timeout=5)
except requests.exceptions.Timeout:

raise TimeoutError(f"Request to OpenMeteo API timed out. URl - {url}")
Expand Down

0 comments on commit f1ff28e

Please sign in to comment.