Skip to content

feat(async): Set priorities to async tasks#14195

Draft
kiblik wants to merge 3 commits intoDefectDojo:devfrom
kiblik:celery_set_prio
Draft

feat(async): Set priorities to async tasks#14195
kiblik wants to merge 3 commits intoDefectDojo:devfrom
kiblik:celery_set_prio

Conversation

@kiblik
Copy link
Contributor

@kiblik kiblik commented Jan 28, 2026

This PR is adding support for priority queues. More important tasks will be processed sooner and vice versa.

The status of each queue is listed in the system settings overview:
image

Queue with id 0 is automatically marked without a suffix (all other are using naming convention celery:1, celery:2...). Thanks to this fact, we are keeping backward compatibility (if there are any tasks in the queue during migration to the new version, we will still process those tasks after the upgrade).

It is a bit harder to write tests for this. But I tested manually (stop worker, play around, start worker, observe logs) and it was working as expected.

The role of each queue is described in settings.dist.py (and reflected in the overview in system settings). If task do not have a priority assigned, priority is set to the default value: 3

I'm open to feedback if priority of any task should be changed.

@github-actions github-actions bot added the settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR label Jan 28, 2026
@kiblik kiblik force-pushed the celery_set_prio branch 3 times, most recently from 95561b9 to 1f8e468 Compare January 29, 2026 17:59
kiblik and others added 2 commits February 3, 2026 13:53
Signed-off-by: kiblik <5609770+kiblik@users.noreply.github.com>
Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>
@github-actions github-actions bot added the ui label Feb 3, 2026
@kiblik kiblik force-pushed the celery_set_prio branch 2 times, most recently from 3dd4cdb to 6eb4791 Compare February 3, 2026 16:03
@kiblik kiblik marked this pull request as ready for review February 3, 2026 16:05
Signed-off-by: kiblik <5609770+kiblik@users.noreply.github.com>
@valentijnscholten valentijnscholten added the affects_pro PRs that affect Pro and need a coordinated release/merge moment. label Feb 4, 2026
@valentijnscholten valentijnscholten added this to the 2.56.0 milestone Feb 5, 2026
@valentijnscholten valentijnscholten marked this pull request as draft February 5, 2026 21:15
@valentijnscholten
Copy link
Member

I've converted it to draft as we can only test/merge this after 2.55.2 has been released and merged back into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_pro PRs that affect Pro and need a coordinated release/merge moment. settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR ui

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants