Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: consider celery imports from common settings plus env tokens #29739

Merged
merged 1 commit into from Apr 14, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions lms/envs/common.py
Expand Up @@ -2693,11 +2693,17 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring

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

CELERY_IMPORTS = (
CELERY_IMPORTS = [
# Since xblock-poll is not a Django app, and XBlocks don't get auto-imported
# by celery workers, its tasks will not get auto-discovered:
'poll.tasks',
)
]

MaferMazu marked this conversation as resolved.
Show resolved Hide resolved
# .. setting_name: CELERY_EXTRA_IMPORTS
# .. setting_default: []
# .. setting_description: Adds extra packages that don't get auto-imported (Example: XBlocks).
# These packages are added in addition to those added by CELERY_IMPORTS.
CELERY_EXTRA_IMPORTS = []

# Message configuration

Expand Down
3 changes: 3 additions & 0 deletions lms/envs/production.py
Expand Up @@ -1068,3 +1068,6 @@ def get_env_setting(setting):

############## DRF overrides ##############
REST_FRAMEWORK.update(ENV_TOKENS.get('REST_FRAMEWORK', {}))

############################# CELERY ############################
CELERY_IMPORTS.extend(ENV_TOKENS.get('CELERY_EXTRA_IMPORTS', []))
MaferMazu marked this conversation as resolved.
Show resolved Hide resolved