Skip to content

Commit

Permalink
celery_app: set task routes to prevent unnamed queue
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Apr 22, 2024
1 parent 6c820aa commit e40988f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,16 @@ def create_celery() -> Celery:
],
related_name=None,
)
created.conf.task_routes = {
"tasks.ocr_task": {"queue": "ocr"},
"tasks.output_project_task": {"queue": "output"},
"tasks.import_from_labelplus_task": {"queue": "output"},
}
created.conf.task_routes = (
[
# TODO 'output' should be named better.
# its original purpose was cpu-intensive jobs that may block light ones.
("tasks.output_project_task", {"queue": "output"}),
("tasks.import_from_labelplus_task", {"queue": "output"}),
("tasks.mit.*", {"queue": "mit"}),
("*", {"queue": "default"}), # default queue for all other tasks
],
)
return created


Expand Down

0 comments on commit e40988f

Please sign in to comment.