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

fix: run Celery tasks asynchronously in dev mode #928

Closed
wants to merge 1 commit into from
Closed
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: 1 addition & 0 deletions changelog.d/20231025_122158_kyle_celery_async.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] In development mode, Celery tasks will now be delegated to worker containers for asynchronous execution rather than eagerly exected by the lms/cms app processes. This matches the behavior of production mode and should enable more robust testing & debugging of Celery tasks. Unit tests, however, will still eagerly execute Celery tasks in-process (by @kdmccormick).
3 changes: 3 additions & 0 deletions tutor/templates/apps/openedx/settings/partials/common_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,8 @@
"user": None,
}

# Run Celery tasks asynchronously on the workers (rather than blocking the app process).
CELERY_ALWAYS_EAGER = False

{{ patch("openedx-common-settings") }}
######## End of settings common to LMS and CMS
4 changes: 4 additions & 0 deletions tutor/templates/apps/openedx/settings/partials/common_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Fix MongoDb connection credentials
DOC_STORE_CONFIG["user"] = None
DOC_STORE_CONFIG["password"] = None

# In edx-platform CI, unit tests are run in-process, so many of them break if run
# async on the workers. So, we default to testing them in-process as well.
CELERY_ALWAYS_EAGER = True