django-celery-beat
django-celery-beat copied to clipboard
celery beat_schedule can not automove
Summary:
old scheduled job setting by app.conf.beat_schedule in the celery.py can not auto delete.
- Celery Version: 4.4.7
- Celery-Beat Version: 1.6.0(django-celery-beat)
Exact steps to reproduce the issue:
- add crontab job into app.conf.beat_schedule in the celery.py
- run celery worker and job begin running, django_celery_beat_periodictask table can find it
- remove the crontab job into app.conf.beat_schedule in the celery.py
- restart celery worker, and the crontab job still work
Detailed information
In my project, I initially used app.conf.beat_schedule in the celery.py file to set up my periodic tasks, and it worked fine. Then I want to use django_celery_beat to dynamically add periodic tasks. In order to prevent bugs, I was evaluating the impact of introducing django_celery_beat on the tasks set by the original app.conf.beat_schedule, and found that the original task cycle has changed. Indeed, django_celery_beat will help me modify the task cycle accordingly, but if I remove the original task, django_celery_beat will not delete it from the django_celery_beat_periodictask table. The deleted periodic task seems to continue to work.
I'm having a similar case: I'm using app.conf.beat_schedule
to handle my periodic tasks. However, If I modify them; the django_celery_beat_periodictask is not updated. So the periodic tasks in the database have a different configuration than the one in app.conf.beat_schedule
. This is producing that some tasks are launched twice in different moments.