Repository navigation
LVT-382: Preserve event freshness during scheduled worker runs - #133
Conversation
Six-hour Cron starts enter the minute-level event loop on local competition dates, then drain and exit when events finish. This makes the November rollout safe without a manual event-day mode switch. Record the production baseline and private preview verification setup.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🚅 Deployed to the lovat-pr-133 environment in lovat
1 service not affected by this PR
|
Lovat AI reviewStatus: completed · Model: Reviewed commit: Critical: 0 · High: 0 · Medium: 0 · Low: 0 Overall assessmentThe pull request successfully implements a new scheduled worker mode to handle event-aware, finite runs, which is critical for preserving event freshness. The logic in No high-confidence issues were found in the reviewed changes. Review details
Limitations
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8f545af3ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
📱 Connect your app to this PR deploymentScan a QR code to use this PR's Server API. Worker changes use the same API; Server URL: |
jackshim415
left a comment
There was a problem hiding this comment.
Reviewed event-local transitions, stopping batch claims on active-event discovery, draining and production/rollback IaC defaults. The discovery/backlog finding is fixed and tested; the suggestion to leave a Cron process's Prisma pool open was rejected because each execution owns and must close its pool. Required CI, Worker and IaC checks pass; local verification includes 73 Worker and seven IaC tests. The isolated Railway batch completed in 25.7 seconds, maintenance and a season import succeeded, failed imports retained retry delays, and Worker has zero running replicas. Production Cron is staged only; activation remains gated on the final preview sleep/wake request.
What changed
Cron rollout needs to preserve minute-level freshness for the November 21 event without relying on a manual event-day switch. Add
WORKER_MODE=scheduled: six-hour Cron starts drain a finite batch outside competition dates, keep the continuous loop running during event-local competition dates, and drain/exit when all current event dates end. A catalog batch discovering an active event enters continuous mode immediately.IaC requires six-hour Cron for scheduled mode. Daily batch and standalone continuous modes retain their existing behavior. Record live production resource/latency baselines and the isolated verification setup.
Areas affected
Contracts and data
Verification
git diff --checkpassed.lvt-382-verificationenvironment. Production Cron remains unchanged until those gates pass.Deployment
No migrations or Railway credentials in Worker. Use both local IaC inputs
RAILWAY_WORKER_CRON='0 */6 * * *'andRAILWAY_WORKER_MODE=scheduledfor the current upcoming-event window. Production Postgres already has sleep enabled; actual sleep and billing evidence is still pending. Related: LVT-382, implementation PR #132.