Skip to content
Snippets Groups Projects
Unverified Commit 19847514 authored by Feanil Patel's avatar Feanil Patel Committed by GitHub
Browse files

Merge pull request #25822 from edx/feanil/celery_worker_fix

Only instantiate one celery app per process.
parents 774210cf ab6bf348
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ registration and discovery can work correctly.
Import sorting is intentionally disabled in this module.
isort:skip_file
"""
import os
# We monkey patch Kombu's entrypoints listing because scanning through this
# accounts for the majority of LMS/Studio startup time for tests, and we don't
......@@ -20,4 +20,5 @@ kombu.utils.entrypoints = lambda namespace: iter([])
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import APP as CELERY_APP
if os.environ.get('SERVICE_VARIANT', 'cms').startswith('cms'):
from .celery import APP as CELERY_APP
......@@ -2,6 +2,7 @@
Celery needs to be loaded when the cms modules are so that task
registration and discovery can work correctly.
"""
import os
# We monkey patch Kombu's entrypoints listing because scanning through this
# accounts for the majority of LMS/Studio startup time for tests, and we don't
......@@ -16,4 +17,5 @@ kombu.utils.entrypoints = lambda namespace: iter([])
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import APP as CELERY_APP
if os.environ.get('SERVICE_VARIANT', 'lms').startswith('lms'):
from .celery import APP as CELERY_APP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment