From bd129aea5c59149a62cf5a631aae3fe8d50dca84 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 4 Aug 2024 16:17:52 +0100 Subject: [PATCH] Bug fix --- agenda/fx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agenda/fx.py b/agenda/fx.py index 0e22711..737b43a 100644 --- a/agenda/fx.py +++ b/agenda/fx.py @@ -85,7 +85,7 @@ def get_rates(config: flask.config.Config) -> dict[str, Decimal]: delta = now - recent full_path = os.path.join(fx_dir, recent_filename) - if not recent_filename.endswith(file_suffix) or delta < timedelta(hours=12): + if recent_filename.endswith(file_suffix) and delta < timedelta(hours=12): return read_cached_rates(full_path, currencies) url = "http://api.exchangerate.host/live"