Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b3c9057950
ℹ️ 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".
| def ready(self): | ||
| from .ap_scheduler import start | ||
| start() |
There was a problem hiding this comment.
Guard scheduler startup to a single process
AppConfig.ready() runs in every Django process, so calling start() here creates a separate BackgroundScheduler per worker/autoreload process/management command process; in multi-worker deployments this makes the same cron jobs fire multiple times, causing duplicate episode-update runs and repeated external API traffic with potential races. Please gate scheduler startup to a single dedicated process (or use a distributed lock/leader election) before invoking start().
Useful? React with 👍 / 👎.
@codex