Don't install instructor_task for common testing. (#25459)

* Import instructor tasks explicitly on workers.

Importing them via app config leads to an dependency chain nightmare as lots of other apps get pulled into the startup
and are not configured in situations like testing the common and lib unit tests.  This should register tasks to the celery
workers without messing with the startup dependency chains of the LMS, CMS and test setup.
This commit is contained in:
Feanil Patel
2020-10-27 18:34:27 -04:00
committed by GitHub
parent 1d28f5d60f
commit 0191f2f1bb
2 changed files with 5 additions and 3 deletions

View File

@@ -12,5 +12,4 @@ class InstructorTaskConfig(AppConfig):
name = u'lms.djangoapps.instructor_task'
def ready(self):
# noinspection PyUnresolvedReferences
from . import tasks # pylint: disable=unused-import
pass

View File

@@ -2233,7 +2233,10 @@ DEBUG_TOOLBAR_PATCH_SETTINGS = False
# Celery's task autodiscovery won't find tasks nested in a tasks package.
# Tasks are only registered when the module they are defined in is imported.
CELERY_IMPORTS = (
'poll.tasks'
'poll.tasks',
'lms.djangoapps.instructor_task.tasks',
'lms.djangoapps.bulk_email.tasks',
'openedx.core.djangoapps.bookmarks.tasks',
)
# Message configuration