Нулевые задачи выполняются в Celery с супервизором
Я использую Celery с Django, и он прекрасно работает, когда я использую команду celery
и запускаю worker
и beat
по отдельности, но когда я использую supervisor для запуска Celery в качестве демона, никакие задачи не запускаются.
supervisorctl status all
[sudo] password for ahmed:
beat RUNNING pid 22064, uptime 1:29:20
worker RUNNING pid 22063, uptime 1:29:20
celery.conf
файл в /etc/supervisor/conf.d/celery.conf
; ==========================================
; celery worker config
; ==========================================
[program: worker]
command=/home/ahmed/.local/bin/celery -A decimal_trade worker -l info
directory=/home/ahmed/PycharmProjects/decimal-trade
user=ahmed
numprocs=1
stdout_logfile=/home/ahmed/PycharmProjects/decimal-trade/celery/log/worker.log
stderr_logfile=/home/ahmed/PycharmProjects/decimal-trade/celery/log/worker.err.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
killasgroup=true
priority=998
; priority 998 executes first and then 999
; ========================================
; celery beat config
; ========================================
[program: beat]
command=/home/ahmed/.local/bin/celery -A decimal_trade beat -l info
directory=/home/ahmed/PycharmProjects/decimal-trade
user=ahmed
numprocs=1
stdout_logfile=/home/ahmed/PycharmProjects/decimal-trade/celery/log/beat.log
stderr_logfile=/home/ahmed/PycharmProjects/decimal-trade/celery/log/beat.err.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 600
killasgroup=true
priority=999
Журнал worker
-------------- celery@ahmed-Lenovo-V14-G1-IML v5.3.6 (emerald-rush)
--- ***** -----
-- ******* ---- Linux-6.2.0-39-generic-x86_64-with-glibc2.35 2024-03-14 18:19:37
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: decimal_trade:0x7fa64756c3d0
- ** ---------- .> transport: redis://localhost:6379/0
- ** ---------- .> results: redis://localhost:6379/0
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks]
. symbols.tasks.task_one
. symbols.tasks.task_two
журнал beat
журнал
celery beat v5.3.6 (emerald-rush) is starting.
__ - ... __ - _
LocalTime -> 2024-03-14 18:29:37
Configuration ->
. broker -> redis://localhost:6379/0
. loader -> celery.loaders.app.AppLoader
. scheduler -> celery.beat.PersistentScheduler
. db -> celerybeat-schedule
. logfile -> [stderr]@%INFO
. maxinterval -> 5.00 minutes (300s)