3

Just to clarify things - I am working on a systemd service file celerybeat.service which should take care of the Celery beat. What I am doing at the moment is calling a script which reads /var/run/celery/celerybeat.pid, kills process with that PID, and then starts Celery beat process again.

Is there a better way to accomplish this?

1 Answers1

5

What we do is we start celery like this (our celery app is in server.py):

python -m server --app=server multi start workername -Q queuename -c 30 --pidfile=celery.pid --beat

Which starts a celery beat process with 30 worker processes, and saves the pid in celery.pid.

Then we can call this to cleanly exit:

celery multi stop workername --pidfile=celery.pid
jaapz
  • 166
  • 3