2.6 KiB
2.6 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |
|---|---|---|---|---|---|---|---|---|
| TASK-240 | Implement ranking and historical snapshot scheduler | done | backend | Backend Senior |
|
foundation | high |
TASK-240 - Implement ranking and historical snapshot scheduler
Goal
Implement the real out-of-band scheduler for ranking and historical public snapshots so ranking.html and historico.html no longer depend on the daily full refresh to populate weekly and monthly data.
Context
The previous audit in TASK-237 documented the gap but did not change runtime behavior. The runner refreshed ranking snapshots and recent matches, but the broader historical weekly/monthly snapshot subset used by the public historical page could remain missing for hours.
Steps
- Reviewed scheduler, snapshot generators, config and Compose wiring.
- Added slot-based public jobs with explicit cadence and non-overlap rules.
- Extended docs and tests for the implemented cadence.
Files to Read First
AGENTS.mdai/architecture-index.mdai/repo-context.mdbackend/app/historical_runner.pybackend/app/historical_snapshots.pydocs/public-snapshot-refresh-schedule.md
Expected Files to Modify
backend/app/config.pybackend/app/historical_runner.pybackend/app/historical_snapshots.pybackend/app/rcon_historical_leaderboards.pybackend/tests/test_historical_snapshot_refresh.pydocker-compose.ymldocs/public-snapshot-refresh-schedule.md
Constraints
- No public request-time regeneration.
- No RCON host, port or server configuration changes.
- No Elo/MMR reactivation.
- No Comunidad Hispana #03 reintroduction.
- Keep the scheduler simple: locks and controlled skips instead of external dependencies.
Validation
python -m compileall backend/appcd backend; python -m unittest tests.test_historical_snapshot_refreshcd backend; python -m unittest tests.test_current_match_payload tests.test_rcon_admin_log_storage tests.test_historical_snapshot_refreshgit diff --name-only
Outcome
- Implemented wall-clock public jobs for ranking weekly/monthly and historical weekly/monthly subsets.
- Added manual runner entrypoints through
python -m app.historical_runner --public-job .... - Kept recent matches on the existing fast path.
- Left request contracts compatible;
generated_atremains the last-update field used by the public historical UI.
Change Budget
- Scope exceeded the ideal small-task budget because scheduler, snapshot generation, tests, Compose wiring and docs had to move together to avoid partial behavior.