From ee1eaa104663348e3aa95087682ec94373f3dbc2 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Tue, 18 Feb 2025 00:46:36 +0000 Subject: [PATCH] Handle FX rate timeouts. --- agenda/fx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agenda/fx.py b/agenda/fx.py index de70146..61c4bb7 100644 --- a/agenda/fx.py +++ b/agenda/fx.py @@ -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: