Season metadata (playoff flag, season names, dates)
The provider_league_id in schema.sql is the client_code value (e.g., ohl, ahl, lhjmq for QMJHL).
Cache TTLs
Data
TTL
Full season schedule
30 minutes
Teams
24 hours
Seasons metadata
24 hours
Past games
7 days
Today’s games
30 minutes
Tomorrow’s games
4 hours
3-7 days out
8 hours
8+ days out
24 hours
The provider fetches the full season schedule and caches it, then filters by date for individual queries. This reduces API calls significantly.
Special Behaviors
Full schedule caching: get_team_schedule() fetches the entire season once, then filters locally
Lookback: Scans 7 days back to resolve .last template variables
QMJHL client code: Uses lhjmq (French: Ligue de hockey junior majeur du Québec)
Thread-safe: Connection pooling with configurable limits
Season type via seasons view: HockeyTech’s schedule feed leaves game_type empty for every game, but each game has a season_id. The separate seasons view is joined in to map season_id → canonical season_type: playoff == "1" → postseason; season_name containing preseason / pre-season / exhibition → preseason; anything else → regular. Showcase/All-Star seasons (e.g. “AHL 2026 All-Star Challenge”, “OHL Top Prospects”) fall into regular since they have no playoff flag and no preseason keyword.