Skip to content

Commit

Permalink
refactor!: use new filter to define celery command
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Nov 22, 2024
1 parent b3ea70e commit 4718af6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 28 deletions.
2 changes: 1 addition & 1 deletion tutorcelery/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "19.0.0"
__version__ = "18.3.0"
26 changes: 0 additions & 26 deletions tutorcelery/patches/k8s-override

This file was deleted.

14 changes: 13 additions & 1 deletion tutorcelery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import click
import importlib_resources
import tutor
from tutor import hooks
from tutor import hooks, config

from .__about__ import __version__
from .hooks import CELERY_WORKERS_CONFIG, CELERY_WORKERS_ATTRS_TYPE
Expand Down Expand Up @@ -80,6 +80,18 @@ def is_celery_multiqueue(service: str) -> bool:
return True


@hooks.Actions.PROJECT_ROOT_READY.add()
def run_this_on_start(config):
if is_celery_multiqueue("lms"):
hooks.Filters.LMS_WORKER_COMMAND.add_items([
"--queues=edx.lms.core.default"
])
if is_celery_multiqueue("cms"):
hooks.Filters.CMS_WORKER_COMMAND.add_items([
"--queues=edx.cms.core.default"
])


hooks.Filters.CONFIG_DEFAULTS.add_items(
[
# Add your new settings that have default values here.
Expand Down

0 comments on commit 4718af6

Please sign in to comment.