Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celery beat_schedule can not automove #706

Open
xiaobaiyang-programer opened this issue Dec 21, 2023 · 1 comment
Open

celery beat_schedule can not automove #706

xiaobaiyang-programer opened this issue Dec 21, 2023 · 1 comment

Comments

@xiaobaiyang-programer
Copy link

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.

@jlariza
Copy link

jlariza commented Jun 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants