Skip to content

feat: Migrate scheduler to native RQ process #2224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

adamantike
Copy link
Contributor

Description
This change replaces our custom scheduler.py script with the rqscheduler command, allowing us to run the RQ scheduler as a separate, low-memory process, by avoiding the need to maintain the Python app in memory.

  • Remove scheduler.py script.
  • Move initialization of scheduled tasks to worker.py.
  • Update docker/init_scripts/init to start the rqscheduler command instead of the custom script.
  • Fix scheduled tasks' func paths to the new project structure.
  • Temporarily use a fork of rq-scheduler to support username and SSL settings in the rqscheduler command.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@adamantike adamantike requested review from gantoine and zurdi15 August 6, 2025 20:48
Copy link

trunk-io bot commented Aug 6, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

Copy link

github-actions bot commented Aug 6, 2025

Test Results

548 tests  ±0   547 ✅ ±0   1m 1s ⏱️ -1s
  1 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 5dcc1bd. ± Comparison against base commit 7e5be1c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Aug 6, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
8738 6159 70% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
backend/tasks/scheduled/scan_library.py 89% 🟢
backend/tasks/scheduled/update_launchbox_metadata.py 98% 🟢
backend/tasks/scheduled/update_switch_titledb.py 100% 🟢
TOTAL 96% 🟢

updated for commit: 5dcc1bd by action🐍

Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

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

🔥 🔥 🔥

This change replaces our custom `scheduler.py` script with the
`rqscheduler` command, allowing us to run the RQ scheduler as a
separate, low-memory process, by avoiding the need to maintain
the Python app in memory.

* Remove `scheduler.py` script.
* Move initialization of scheduled tasks to `worker.py`.
* Update `docker/init_scripts/init` to start the `rqscheduler`
  command instead of the custom script.
* Fix scheduled tasks' `func` paths to the new project structure.
* Temporarily use a fork of `rq-scheduler` to support
  username and SSL settings in the `rqscheduler` command.
@adamantike adamantike force-pushed the feat/scheduler-native-process branch from 21e369b to 5dcc1bd Compare August 6, 2025 22:13
@gantoine gantoine merged commit ebe271d into master Aug 7, 2025
9 checks passed
@gantoine gantoine deleted the feat/scheduler-native-process branch August 7, 2025 01:38
@gantoine gantoine mentioned this pull request Aug 7, 2025
4 tasks
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