Handle FX rate timeouts.
This commit is contained in:
parent
c8eca13d68
commit
ee1eaa1046
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue