Skip to content

Commit

Permalink
temp: some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Oct 4, 2024
1 parent 1b6d035 commit 2121bcb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions tutor/templates/apps/openedx/settings/lms/development.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,35 @@

{{ patch("openedx-development-settings") }}
{{ patch("openedx-lms-development-settings") }}

#CELERYD_CONCURRENCY = 2 # worker_concurrency
#CELERYD_MAX_TASKS_PER_CHILD = 100 # worker_max_tasks_per_child
#CELERYD_POOL = 'threads' # worker_pool


CELERY_WORKER_TYPE = os.environ.get("CELERY_WORKER_TYPE", "default")

worker_settings = {
"lms": {
"default": {
"parameters": {
"worker_concurrency": 4,
"worker_pool": "threads"
}
},
"high": {},
"high_mem": {},
},
"cms": {
"default": {},
"low": {},
},
}
from openedx.core.lib.celery import APP

worker_variants = worker_settings.get(SERVICE_VARIANT)
for variant, config in worker_variants.items():
if CELERY_WORKER_TYPE == variant:
for parameter, value in config.get("parameters", {}).items():
conf = APP.conf
setattr(conf, parameter, value)
2 changes: 1 addition & 1 deletion tutor/templates/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ services:
environment:
SERVICE_VARIANT: lms
DJANGO_SETTINGS_MODULE: lms.envs.tutor.production
command: celery --app=lms.celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --max-tasks-per-child=100 --exclude-queues=edx.cms.core.default
command: celery --app=lms.celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --exclude-queues=edx.cms.core.default
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms:/openedx/edx-platform/lms/envs/tutor:ro
Expand Down

0 comments on commit 2121bcb

Please sign in to comment.