1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/weblate_ynh.git synced 2024-10-01 13:35:04 +02:00

align celery config with upstream

This commit is contained in:
Jean-Baptiste Holcroft 2019-08-30 22:21:30 +02:00
parent f27261fe4e
commit 4214a1391c
2 changed files with 15 additions and 14 deletions

View file

@ -1,18 +1,18 @@
# Name of nodes to start
# here we have a single node
CELERYD_NODES="w1"
# or we could have three nodes:
#CELERYD_NODES="w1 w2 w3"
CELERYD_NODES="celery notify search memory"
# Absolute or relative path to the 'celery' command:
CELERY_BIN="__FINALPATH__/venv/bin/celery"
# App instance to use
# comment out this line if you don't use an app
CELERY_APP="weblate"
# How to call manage.py
CELERYD_MULTI="multi"
# Extra command-line arguments to the worker
CELERYD_OPTS="--beat"
CELERYD_OPTS="--beat:celery --concurrency:celery=4 --queues:celery=celery --prefetch-multiplier:celery=4 \
--concurrency:notify=4 --queues:notify=notify --prefetch-multiplier:notify=4 \
--concurrency:search=1 --queues:search=search --prefetch-multiplier:search=2000 \
--concurrency:memory=1 --queues:memory=memory --prefetch-multiplier:memory=2000"
# - %n will be replaced with the first part of the nodename.
# - %I will be replaced with the current child process index
@ -21,4 +21,5 @@ CELERYD_PID_FILE="/var/run/__APP__/weblate-celery-%n.pid"
CELERYD_LOG_FILE="/var/log/__APP__/weblate-celery-%n%I.log"
CELERYD_LOG_LEVEL="INFO"
# Internal Weblate variable to indicate we're running inside Celery
CELERY_WORKER_RUNNING="1"

View file

@ -14,14 +14,14 @@ RuntimeDirectory=__APP__
ExecStartPre=/bin/chown -R __APP__ /var/log/__APP__
ExecStart=__FINALPATH__/venv/bin/celery multi start ${CELERYD_NODES} \
ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}
ExecStop=__FINALPATH__/venv/bin/celery multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}
ExecReload=__FINALPATH__/venv/bin/celery multi restart ${CELERYD_NODES} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
--pidfile=${CELERYD_PID_FILE}'
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]
WantedBy=multi-user.target