chenwardT / lol_stats2

Website to perform match aggregation and analysis for Riot Games' League of Legends.
2 stars 0 forks source link

Celery results die by TTL instead of being removed when no longer needed #18

Open chenwardT opened 8 years ago

chenwardT commented 8 years ago

The redis store will contain key-value pairs long after they are no longer needed.

These keys take the form celery-task-meta-<id> ("celery-task-meta" is the default key prefix) and are representative of results that can be instantiated (and deleted) via e.g.:

from celery.result import AsyncResult

res = AsyncResult("b79a674c-f306-4486-b291-bfdb5a85673f")
res.forget()

Ideally these are removed intelligently when no longer needed instead of being subject to autoexpiry rules.

Additionally, instead of removing results, we can avoid creating them when they're not needed by passing ignore_result=True to task config (e.g. decorator).