Disable pidfile for celerybeat

2020-03-08 09:21发布

celeryd doesn't require a pidfile, but celerybeat seems to. Is there any way to disable it? I'm using Upstart to manage processes so using a pidfile is redundant.

2条回答
forever°为你锁心
2楼-- · 2020-03-08 09:55

The following seems to have worked for a few people so I'm submitting it as the answer:

python manage.py celerybeat --pidfile= --schedule=/var/my_app/celerybeat-schedule

--pidfile= (an empty string as the pidfile arg) seems to stop one being created.

查看更多
Emotional °昔
3楼-- · 2020-03-08 09:59

So for me, I ammended the following in my development docker-compose.yml file:

web
    ...
    command: bash -c "python3 manage.py makemigrations && python3 manage.py migrate --run-syncdb && python3 manage.py runserver 0.0.0.0:8982"

to:

web
    ...
    command: bash -c "rm -rf celerybeat.pid && python3 manage.py makemigrations && python3 manage.py migrate --run-syncdb && python3 manage.py runserver 0.0.0.0:8982"

I'm sure there is a more elegant way of cleaning up this file on startup or even shutdown?

查看更多
登录 后发表回答