feat: start celery worker programmatically (#2988)

### Description

Allow us to be more flexible with the option passed the celery worker,
for example, to change the logging level.
This commit is contained in:
Jonas L 2024-04-13 21:03:57 +02:00 committed by GitHub
parent 7040d0e4bd
commit 9c548b365e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 16 deletions

View file

@ -22,14 +22,7 @@ Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
Environment=LIBRETIME_LOG_FILEPATH=@@LOG_DIR@@/worker.log
WorkingDirectory=@@WORKING_DIR@@/worker
ExecStart=/usr/bin/sh -c '@@VENV_DIR@@/bin/celery worker \
--app=libretime_worker.tasks:worker \
--config=libretime_worker.config \
--beat \
--time-limit=1800 \
--concurrency=1 \
--loglevel=INFO \
--logfile=$LIBRETIME_LOG_FILEPATH'
ExecStart=/usr/local/bin/libretime-worker
Restart=always
User=libretime