Handle FX rate timeouts.

This commit is contained in:
Edward Betts 2025-02-18 00:46:36 +00:00
parent c8eca13d68
commit ee1eaa1046

View file

@ -96,8 +96,8 @@ def get_rates(config: flask.config.Config) -> dict[str, Decimal]:
filename = f"{now_str}_{file_suffix}"
try:
with httpx.Client() as client:
response = client.get(url, params=params)
except httpx.ConnectError:
response = client.get(url, params=params, timeout=10)
except (httpx.ConnectError, httpx.ReadTimeout):
return read_cached_rates(full_path, currencies)
try: