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}"
|
filename = f"{now_str}_{file_suffix}"
|
||||||
try:
|
try:
|
||||||
with httpx.Client() as client:
|
with httpx.Client() as client:
|
||||||
response = client.get(url, params=params)
|
response = client.get(url, params=params, timeout=10)
|
||||||
except httpx.ConnectError:
|
except (httpx.ConnectError, httpx.ReadTimeout):
|
||||||
return read_cached_rates(full_path, currencies)
|
return read_cached_rates(full_path, currencies)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue