fix: anchor Day N to each round's first game instead of lazy first sighting
CI / Lint (push) Successful in 5s
CI / Test (push) Successful in 9s
CI / Build & Push (push) Successful in 19s

The banner read "Day 1 of ~60" on day 2 of the playoffs because the old
anchor recorded whatever date we first polled a playoff game as Day 1.
Now round start dates come from /v1/schedule/playoff-series, so Day N
is authoritative and resets at each round boundary. Drops the noisy
"of ~60" denominator.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-19 13:03:08 -04:00
parent 930247b32f
commit a88e2edef0
7 changed files with 220 additions and 94 deletions
+3 -1
View File
@@ -4,7 +4,7 @@ import time
import schedule
from app.api import refresh_scores
from app.playoff_cache import refresh_bracket
from app.playoff_cache import refresh_bracket, refresh_round_start_dates
from app.standings import refresh_standings
logger = logging.getLogger(__name__)
@@ -14,8 +14,10 @@ def start_scheduler():
schedule.every(600).seconds.do(refresh_standings)
schedule.every(10).seconds.do(refresh_scores)
schedule.every(3600).seconds.do(refresh_bracket)
schedule.every(21600).seconds.do(refresh_round_start_dates)
# Populate the cache once at startup so the banner has data immediately.
refresh_bracket()
refresh_round_start_dates()
logger.info("Background scheduler started")
while True:
try: