Skip to content

Commit

Permalink
Use correct env-var for extra index TTLs
Browse files Browse the repository at this point in the history
Fixes #57
  • Loading branch information
EpicWink committed Sep 25, 2024
1 parent 78568b6 commit 22bbce9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/proxpi/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,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))
Expand Down

0 comments on commit 22bbce9

Please sign in to comment.