From a9bcf22169c95dc04219e454941dc11949936d22 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Thu, 10 Dec 2020 14:14:42 +0000 Subject: [PATCH] Revert "Only instantiate one celery app per process." --- cms/__init__.py | 5 ++--- lms/__init__.py | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/cms/__init__.py b/cms/__init__.py index d7629a0d31..fd763b62c2 100644 --- a/cms/__init__.py +++ b/cms/__init__.py @@ -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,5 +20,4 @@ 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. -if os.environ.get('SERVICE_VARIANT', 'cms').startswith('cms'): - from .celery import APP as CELERY_APP +from .celery import APP as CELERY_APP diff --git a/lms/__init__.py b/lms/__init__.py index ce1f0d5ad8..5508a6a75c 100644 --- a/lms/__init__.py +++ b/lms/__init__.py @@ -2,7 +2,6 @@ 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 @@ -17,5 +16,4 @@ 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. -if os.environ.get('SERVICE_VARIANT', 'lms').startswith('lms'): - from .celery import APP as CELERY_APP +from .celery import APP as CELERY_APP