Cache economic calendar for 1 hour, fix SCAN_BUTTONS test for EUR-only

The weekly calendar JSON was re-fetched on every scan cycle (~288
calls/day). Now cached per-instance with 1-hour TTL, cutting to ~24.
Currency filtering still applied on each read so cached events stay
correct across pairs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
harwinder
2026-05-21 19:36:15 -04:00
parent 0593e455bc
commit 5ad5640ad1
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -1475,7 +1475,7 @@ def _():
@test("SCAN_BUTTONS and SCAN_LOOKUP consistency")
def _():
assert len(SCAN_BUTTONS) == 10 # 5 per pair (4 TFs + All) × 2 pairs
assert len(SCAN_BUTTONS) == 5 # 4 TFs + All for EUR/USD
for btn in SCAN_BUTTONS:
assert btn["cb"] in SCAN_LOOKUP
assert "symbol" in btn