Skip to content

fix: seperate scheduler executors#242

Merged
uwwint merged 1 commit into
mainfrom
fix/scheduler-seperate-executors
Mar 27, 2026
Merged

fix: seperate scheduler executors#242
uwwint merged 1 commit into
mainfrom
fix/scheduler-seperate-executors

Conversation

@uwwint

@uwwint uwwint commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

Description

seperate scheduler executors

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)
  • For any new secrets, I have updated the shared spreadsheet and the GitHub Secrets.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_EXECUTOR and configure it as a single-worker threadpool executor.
  • Route non-email scheduled jobs to SCHEDULED_TASK_EXECUTOR and email-queue jobs to EMAIL_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.

Comment thread run_scheduler.py
Comment thread scheduled_tasks/tasks.py
@uwwint uwwint merged commit 8afb774 into main Mar 27, 2026
9 checks passed
@uwwint uwwint deleted the fix/scheduler-seperate-executors branch March 27, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants