Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cms/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import os

from celery import Celery
from django.conf import settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment on the actual line, but probably change the default value for DJANGO_SETTINGS_MODULE in here too?


from openedx.core.lib.celery.routers import AlternateEnvironmentRouter

Expand Down
7 changes: 0 additions & 7 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,13 +1213,6 @@

################################# CELERY ######################################

# Auto discover tasks fails to detect contentstore tasks
CELERY_IMPORTS = (
'cms.djangoapps.contentstore.tasks',
'openedx.core.djangoapps.bookmarks.tasks',
'openedx.core.djangoapps.ccxcon.tasks',
)

# Message configuration

CELERY_TASK_SERIALIZER = 'json'
Expand Down
3 changes: 1 addition & 2 deletions lms/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
import os

from celery import Celery
from django.conf import settings

from openedx.core.lib.celery.routers import AlternateEnvironmentRouter

# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lms.envs.production')

APP = Celery('proj')

Expand Down
9 changes: 0 additions & 9 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2230,15 +2230,6 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring

################################# CELERY ######################################

# 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',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @feanil , edX has gotten reports that XBlock-poll's reporting features are no longer working (TNL-8370), and I think it was caused by this change (but went unnoticed for months?).

The issue is that the poll XBlock is not a django app, so its tasks.py won't get auto-discovered by celery. If so, is it OK if I fix it with a PR here to reinstate CELERY_IMPORTS = ('poll.tasks', ), or is there some other way I should be doing that now?

Previous PR: https://github.com/edx/edx-platform/pull/23700

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Braden, that seems like a fine fix, the other option would be to make the polls code into a django app? Which I would prefer but either is acceptable.

'lms.djangoapps.instructor_task.tasks',
'lms.djangoapps.bulk_email.tasks',
'openedx.core.djangoapps.bookmarks.tasks',
)

# Message configuration

CELERY_TASK_SERIALIZER = 'json'
Expand Down