I have a simple shared celery task like this:
@shared_task
def add():
x = barakah(name="add()", year="add()", month="add()")
x.save()
return "id is add()= " + str(x.id)
And I call it here in this CELERYBEAT_SCHEDULE:
CELERYBEAT_SCHEDULE = {
'add': {
'task': 'water.tasks.add',
'schedule': timedelta(seconds=3),
'args': ()
},
}
This is the celery command I use:
celery -A adi worker -B -l info
It runs fine as per schedule but other old tasks are also executing as well. How do I stop the old tasks? I have even tried uninstalling celery and rabbitmq but the old tasks seem to be cached somewhere. I tried this answer but what I tried didn't work. Any ideas?