fix: seperate scheduler executors#242
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR separates APScheduler execution pools so email-queue work and other scheduled tasks run on dedicated single-worker threadpool executors, reducing the risk of long-running work impacting the main asyncio scheduler loop.
Changes:
- Add a new
SCHEDULED_TASK_EXECUTORand configure it as a single-worker threadpool executor. - Route non-email scheduled jobs to
SCHEDULED_TASK_EXECUTORand email-queue jobs toEMAIL_QUEUE_EXECUTOR. - Add/adjust job wrapper functions and tests to validate executor routing.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps locked project version to 1.1.2. |
| tests/scheduled_tasks/test_scheduler.py | Extends scheduler tests to assert executor presence and correct routing of jobs. |
| scheduled_tasks/tasks.py | Routes email notification delivery jobs to the email executor and adds synchronous “*_job” wrappers around async tasks. |
| scheduled_tasks/scheduler.py | Introduces and wires the new SCHEDULED_TASK_EXECUTOR threadpool executor. |
| run_scheduler.py | Updates job registration to use the dedicated executors and the new “*_job” wrappers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
seperate scheduler executors
Checklist