Menu

You deleted the task from CELERY_BEAT_SCHEDULE. With django-celery-beat, it is still running.
📰

You deleted the task from CELERY_BEAT_SCHEDULE. With django-celery-beat, it is still running.

DEV Community: django·Illia Khorunzhyi·5 days ago
#oXDytR80
#devtodjango#devto#dev#beat#celery
Long article (776 words) — no AI summary yet.
Reading 0:00
15s threshold

Here is a fix that works with Celery's default scheduler. A periodic task is doing something it shouldn't, so you delete its entry from CELERY_BEAT_SCHEDULE , deploy, restart Beat, and it stops.

We did exactly that once. A task was making about 10,000 pointless API calls a day, we removed it from settings, and that was the end of it. Months later we moved Beat's schedule into the database with django-celery-beat. Then it hit us that the same fix would have changed nothing there.

Why the row outlives the entry

DatabaseScheduler copies your settings into the PeriodicTask table every time Beat starts. This is the whole sync in django-celery-beat 2.9.0:

# django_celery_beat/schedulers.py def setup_schedule ( self ) : self . install_default_entries ( self . schedule ) self . update_from_dict ( self . app . conf . beat_schedule )

# ModelEntry.from_entry, called once per entry obj , created = PeriodicTask . _default_manager . update_or_create ( name = name , defaults = cls .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.