How django-celery-beat models work
mainThe extension uses several models to manage scheduling:
PeriodicTask: Defines a single task to be run. It is associated with either anIntervalScheduleor aCrontabSchedule.IntervalSchedule: Defines a frequency (e.g., every X seconds).CrontabSchedule: Defines a schedule using cron-like fields (minute,hour, etc.).PeriodicTasks: An index model used to track schedule changes.
Important: If you perform bulk updates on PeriodicTask objects, you must manually call PeriodicTasks.update_changed() to notify the celery beat service to reload the schedule from the database.
from django_celery_beat.models import PeriodicTasks
# Call this after bulk updates to trigger a schedule reload
PeriodicTasks.update_changed()