Reputation: 6665
I am pretty new to Celery and I thought I had read somewhere that the task results only stay around for a limited time. However my backend (redis) is getting pretty bloated after running a lot of tasks through it.
Is there a way to set a TTL on task results or is this something I need to manually purge (and how)?
Upvotes: 10
Views: 7365
Reputation: 794
According to the celery documentation you can completely ignore all results using CELERY_IGNORE_RESULT
.
You can also expire results after a set amount of time using CELERY_RESULT_EXPIRES
, which defaults to 1 day. In the notes it says this should just work with the redis backend, whereas some of the other backends require celery beat
to be running.
There is also the CELERY_MAX_CACHED_RESULTS
setting that caches up to 5,000 results by default.
Upvotes: 16