From 3d86e79b15a79bd0c7973f62e85547359cca27c4 Mon Sep 17 00:00:00 2001 From: Laurie O Date: Wed, 25 Sep 2024 13:47:12 +1000 Subject: [PATCH] Use correct env-var for extra index TTLs Fixes #57 --- src/proxpi/_cache.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/proxpi/_cache.py b/src/proxpi/_cache.py index cc59d62..0381c83 100644 --- a/src/proxpi/_cache.py +++ b/src/proxpi/_cache.py @@ -29,7 +29,14 @@ INDEX_TTL = int(os.environ.get("PROXPI_INDEX_TTL", 1800)) EXTRA_INDEX_TTLS = [ - int(s) for s in os.environ.get("PROXPI_EXTRA_INDEX_TTL", "").strip().split(",") if s + int(s) + for s in ( + os.environ.get("PROXPI_EXTRA_INDEX_TTL", "") # backwards-compatible + or os.environ.get("PROXPI_EXTRA_INDEX_TTLS", "") + ) + .strip() + .split(",") + if s ] or [180] * len(EXTRA_INDEX_URLS) CACHE_SIZE = int(os.environ.get("PROXPI_CACHE_SIZE", 5368709120))