Files
edx-platform/cms/envs/devstack_with_worker.py
Andy Shultz 569403f4ae fix: update devstack with worker for cache and proper redis
https://github.com/openedx/edx-platform/pull/31261 fixed celery
cache behavior when not running a worker and made sure production
would keep the old cache behavior, but missed these secret alternate
settings files, bring them up to date.

Also fixes the cms file to have the actual broker URL.
2022-12-12 11:17:54 -05:00

28 lines
1.1 KiB
Python

"""
This config file follows the devstack enviroment, but adds the
requirement of a celery worker running in the background to process
celery tasks.
When testing locally, run lms/cms with this settings file as well, to test queueing
of tasks onto the appropriate workers.
In two separate processes on devstack:
paver devstack studio --settings=devstack_with_worker
DJANGO_SETTINGS_MODULE=cms.envs.devstack_with_worker celery worker --app=cms.celery:APP
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from cms.envs.devstack import *
# Require a separate celery worker
CELERY_ALWAYS_EAGER = False
CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = True
BROKER_URL = 'redis://:password@edx.devstack.redis:6379/'
# Disable transaction management because we are using a worker. Views
# that request a task and wait for the result will deadlock otherwise.
for database_name in DATABASES:
DATABASES[database_name]['ATOMIC_REQUESTS'] = False