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:
parent
f27261fe4e
commit
4214a1391c
2 changed files with 15 additions and 14 deletions
|
@ -1,18 +1,18 @@
|
||||||
# Name of nodes to start
|
# Name of nodes to start
|
||||||
# here we have a single node
|
CELERYD_NODES="celery notify search memory"
|
||||||
CELERYD_NODES="w1"
|
|
||||||
# or we could have three nodes:
|
# Absolute or relative path to the 'celery' command:
|
||||||
#CELERYD_NODES="w1 w2 w3"
|
CELERY_BIN="__FINALPATH__/venv/bin/celery"
|
||||||
|
|
||||||
# App instance to use
|
# App instance to use
|
||||||
# comment out this line if you don't use an app
|
# comment out this line if you don't use an app
|
||||||
CELERY_APP="weblate"
|
CELERY_APP="weblate"
|
||||||
|
|
||||||
# How to call manage.py
|
|
||||||
CELERYD_MULTI="multi"
|
|
||||||
|
|
||||||
# Extra command-line arguments to the worker
|
# 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.
|
# - %n will be replaced with the first part of the nodename.
|
||||||
# - %I will be replaced with the current child process index
|
# - %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_FILE="/var/log/__APP__/weblate-celery-%n%I.log"
|
||||||
CELERYD_LOG_LEVEL="INFO"
|
CELERYD_LOG_LEVEL="INFO"
|
||||||
|
|
||||||
|
# Internal Weblate variable to indicate we're running inside Celery
|
||||||
CELERY_WORKER_RUNNING="1"
|
CELERY_WORKER_RUNNING="1"
|
||||||
|
|
|
@ -14,14 +14,14 @@ RuntimeDirectory=__APP__
|
||||||
|
|
||||||
ExecStartPre=/bin/chown -R __APP__ /var/log/__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} \
|
-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}'
|
||||||
ExecStop=__FINALPATH__/venv/bin/celery multi stopwait ${CELERYD_NODES} \
|
ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \
|
||||||
--pidfile=${CELERYD_PID_FILE}
|
--pidfile=${CELERYD_PID_FILE}'
|
||||||
ExecReload=__FINALPATH__/venv/bin/celery multi restart ${CELERYD_NODES} \
|
ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \
|
||||||
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
|
-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]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in a new issue