Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cleanup taskmeta table of celery

I have Celery running and everything works nice.

Celery uses by default a database table to store the task results, called celery_taskmeta. This table is growing very fast. I read the docs, but I did not find any hint about cleaning up old entries.

Is there a task automatically scheduled by celerybeat, that cleans this table up or do I have to configure something here?

[EDIT]

Is this related with the result backend settings? This is a bit confusing, because documentation says, there is no default value for this. But it seems, that database is the default and it uses the the default configuration of normal Django database configuration.

like image 940
Martin Avatar asked Oct 25 '12 07:10

Martin


1 Answers

You can manually clean this table this way:

from djcelery.models import TaskMeta, states TaskMeta.objects.filter(status=states.SUCCESS).delete()

like image 113
OriolJ Avatar answered Sep 29 '22 07:09

OriolJ