Celery plugin thats adds ability to graceful stop worker
[Celery](http://celeryproject.org) plugin provides ability of graceful worker stopping.
# Problem Production deployment of long running tasks require worker to be stopped gracefully. Unfortunately celery got different behaviour:
celeryresults starting Warm shutdown procedure. Due this procedure,
controlcommands become unavailable.
SIGTERMwith the Cold shutdown procedure.
This module provides more consistent approach to this problem, it
SIGTERMreceiver to prevent default Warm shutdown and Cold shutdown worker behaviour,
controlcommands to be working even after
# Installation & Setup
` pip install git+https://github.com/MnogoByte/celery-graceful-stop.git `
proj/celery.py file containg
app instance with the following lines.
`python import celery_graceful_stop celery_graceful_stop.register(app) `
CELERY_GRACEFUL_STOP(boolean). Controls graceful stop function. (
# Using with systemd
/etc/conf.d/celery_<service_name>configuration file for each worker.
systemctl enable celery@<service_name>.
cancel_consumercontrol commands after receiving
SIGTERMsignal. Actually, you’ll does not need to call them when the worker is shutting down, because worker will not starts new tasks.
BSD - 3