-
-
Notifications
You must be signed in to change notification settings - Fork 257
Refactor task execution workers #2178
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
Conversation
… state in Home.vue
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. |
Test Results543 tests - 3 542 ✅ - 3 1m 0s ⏱️ -1s Results for commit d8af2f8. ± Comparison against base commit 5f0e626. This pull request removes 19 and adds 16 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
0f37127
to
036a66a
Compare
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
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 refactors the task execution system to use a Valkey worker queue for task execution instead of direct execution, which helps avoid timeout issues. The refactoring also introduces a cleaner task inheritance hierarchy and removes the dynamic task discovery mechanism in favor of explicitly defined task registrations.
- Refactored task execution to use
low_prio_queue.enqueue()
instead of directawait task.run()
calls - Introduced a base
Task
class withPeriodicTask
inheriting from it for better type structure - Replaced dynamic task discovery with explicit task registration dictionaries
- Updated task constructors to accept
title
as a required parameter and moved task-specific attributes to constructor arguments
Reviewed Changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
frontend/src/views/Home.vue | Added loading state template with progress indicator for better UX |
frontend/src/components/Settings/Administration/Tasks.vue | Cleaned up task mapping logic and updated type imports from TaskInfoDict to TaskInfo |
backend/tasks/tests/test_tasks.py | Updated test fixtures to include required title parameter in task constructors |
backend/tasks/tasks.py | Introduced base Task class and refactored PeriodicTask to inherit from it with cleaner constructor signature |
backend/tasks/scheduled/*.py | Updated task constructors to use new parameter order with title and manual_run as constructor arguments |
backend/tasks/manual/cleanup_orphaned_resources.py | Converted to inherit from new Task base class with proper constructor |
backend/endpoints/tests/test_tasks.py | Completely rewrote tests to use explicit task mocking instead of dynamic discovery testing |
backend/endpoints/tasks.py | Replaced dynamic task discovery with explicit task dictionaries and updated execution to use worker queue |
backend/endpoints/responses/tasks.py | Renamed TaskInfoDict to TaskInfo for consistency |
backend/endpoints/platform.py | Removed unused properties from platform data structure |
Files not reviewed (2)
- frontend/src/generated/index.ts: Language not supported
- frontend/src/generated/models/TaskInfo.ts: Language not supported
9a07937
to
d8af2f8
Compare
Description
This PR changes the tasks execution to be executed in the valkey worker to avoid timeout issues.
Checklist
Please check all that apply.