1

I have scheduled a task using django celery (djcelery) by defining it as so:

@periodic_task(run_every=timedelta(minutes=1))
def mytask():
    # Do something

I decided to remove this task from the codebase.

However, even after restarting the celery server, this task continues to be scheduled every 1 minute, although it reports an error message since this task no longer exists. Do I have to do something to clear old periodic tasks from the djcelery database, in addition to restarting the server?

zimkies
  • 1,067
  • 1
  • 9
  • 20

1 Answers1

2

You might need to remove your task from the table djcelery_periodictask as well.

  • Thanks. This worked, but it seems unintuitive that you have to manually remove it when you restart the celery server. Is this really the default behaviour? – zimkies May 21 '13 at 21:41
  • It's the default behavior if you use the Django database scheduler. Remove periodic tasks you don't need from the Django Admin or use the default scheduler instead. –  May 22 '13 at 09:58