4.3 KiB
id, title, status, type, team, supporting_teams, roadmap_item, priority
| id | title | status | type | team | supporting_teams | roadmap_item | priority | |
|---|---|---|---|---|---|---|---|---|
| TASK-269 | Implement current match AdminLog freshness worker | done | backend | Backend Senior |
|
current-match | high |
TASK-269 - Implement current match AdminLog freshness worker
Goal
Add an explicit lightweight worker path that keeps current-match AdminLog data fresh for the public current-match page without changing the heavy historical worker cadence globally.
Context
TASK-268 confirmed that /api/current-match/kills and /api/current-match/players do not read live RCON directly. They read persisted rcon_admin_log_events, and those rows are refreshed by the historical AdminLog worker path. The checked-in default worker configuration still points to a 600 second historical interval with a 10 minute AdminLog lookback, which explains observed public lag growing from roughly 333s to 651s while CRCON live already showed newer kills.
The fix for this task must remain operationally conservative:
- do not change RCON hosts, ports, passwords or trusted target definitions
- do not reduce the heavy historical worker interval globally without separate approval
- do not change frontend polling unless backend freshness proves insufficient
- do not reintroduce server
#03
Steps
- Review the existing historical AdminLog ingestion and persistence path.
- Implement a dedicated lightweight current-match AdminLog worker or runner using the same storage path.
- Keep the worker opt-in and deployment-disabled by default.
- Add focused tests for trusted target selection, failure isolation, persistence reuse and config defaults.
- Document deployment and validation without changing production deployment automatically.
Files to Read First
AGENTS.mdai/architecture-index.mdai/repo-context.mdai/orchestrator/backend-senior.mdbackend/app/rcon_historical_worker.pybackend/app/rcon_admin_log_ingestion.pybackend/app/rcon_admin_log_storage.pybackend/app/config.pybackend/app/rcon_client.pybackend/app/postgres_rcon_storage.pydocker-compose.yml
Expected Files to Modify
ai/tasks/in-progress/TASK-269-implement-current-match-adminlog-freshness-worker.mdbackend/app/config.pybackend/app/rcon_admin_log_ingestion.pybackend/app/rcon_current_match_worker.pybackend/tests/test_rcon_current_match_worker.pydocs/current-match-adminlog-freshness.md
Constraints
- Do not run
ai-platform run. - Do not commit or push.
- Do not touch physical assets or
frontend/assets/img/. - Do not touch maps, weapons, clans or brands.
- Do not change RCON hosts, RCON ports,
27001or other server configuration without explicit approval. - Do not reduce the default historical worker interval globally in this task.
- Do not reactivate Elo/MMR.
- Do not reintroduce
comunidad-hispana-03. - Do not touch
ai/system-metrics.md. - Do not include
tmp/, TASK-204 or unrelated pending changes. - Do not use
git add ..
Validation
Before completing the task ensure:
python -m compileall backend/appcd backend; python -m unittest tests.test_current_match_payloadcd backend; python -m unittest tests.test_rcon_current_match_workergit diff --name-onlymatches the expected scope- documentation reflects that deployment remains opt-in
Outcome
Implemented a dedicated lightweight worker entry point in backend/app/rcon_current_match_worker.py.
Final scope delivered:
- trusted-target filtering limited to
comunidad-hispana-01andcomunidad-hispana-02 - reuse of the existing AdminLog fetch/parsing/persistence path
- persistence into the same
rcon_admin_log_eventstable - overlap-safe defaults using existing idempotent dedupe
- explicit opt-in activation only
- deployment documentation without Compose activation changes
Validation completed:
python -m compileall backend/appcd backend; python -m unittest tests.test_current_match_payloadcd backend; python -m unittest tests.test_rcon_current_match_worker
Operational decisions recorded:
- default interval:
10s - default lookback:
180s - enabled default:
false docker-compose.ymlnot changed- deployment activation documented only in docs
Change Budget
- Prefer fewer than 6 modified files.
- Prefer tightly scoped backend-only changes.
- Split follow-up deployment automation into a separate task if approval is required.