Django-celery-beat: PeriodicTask doesn't work after crontab changed in admin?

Created on 9 May 2017  路  6Comments  路  Source: celery/django-celery-beat

I followed instruction after changed my task's schedule:

# in `django-extensions`'s shell
from django_celery_beat.models import PeriodicTask, PeriodicTasks
PeriodicTask.objects.all().update(last_run_at=None)
for task in PeriodicTask.objects.all():
    PeriodicTasks.changed(task)

Since PeriodicTasks.changed() require one argument(It occurs an error!), I execute code like above.

And I waiting until task runs but it didn't....

So I just turn off and on django-celery-beat, then it works..

What's the problem?

verification needed

Most helpful comment

All 6 comments

Same problem

Same problem!!

Having the save issue, had to resort to this because even the loop was letting the last_run_at still reflect as None, breaking beat:

from django.utils import timezone
from django_celery_beat.models import PeriodicTask, PeriodicTasks
last_run = timezone.now().replace(day=22)
PeriodicTask.objects.all().update(last_run_at=last_run)

Having the save issue, had to resort to this because even the loop was letting the last_run_at still reflect as None, breaking beat:

from django.utils import timezone
from django_celery_beat.models import PeriodicTask, PeriodicTasks
last_run = timezone.now().replace(day=22)
PeriodicTask.objects.all().update(last_run_at=last_run)

need to check if this is still needed in master

should be fixed now

Was this page helpful?
0 / 5 - 0 ratings