django-celery-beat icon indicating copy to clipboard operation
django-celery-beat copied to clipboard

celery beat_schedule can not automove

Open xiaobaiyang-programer opened this issue 1 year ago • 1 comments

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:

  1. add crontab job into app.conf.beat_schedule in the celery.py
  2. run celery worker and job begin running, django_celery_beat_periodictask table can find it
  3. remove the crontab job into app.conf.beat_schedule in the celery.py
  4. 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.

xiaobaiyang-programer avatar Dec 21 '23 12:12 xiaobaiyang-programer

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.

jlariza avatar Jun 13 '24 14:06 jlariza