python - Test if a celery task is still being processed -
how can test if task (task_id) still processed in celery? have following scenario:
- start task in django view
- store baseasyncresult in session
- shutdown celery daemon (hard) task not processed anymore
- check if task 'dead'
any ideas? can lookup task being processed celery , check if mine still there?
define field (pickledobjectfield) in model store celery task:
class yourmodel(models.model): . . celery_task = pickledobjectfield() . . def task(): self.celery_task = submittask.apply_async(args = self.task_detail()) self.save()
in case task not specific on model should create 1 celery tasks.
or else suggest using django-celery. has nice monitoring feature:
http://ask.github.com/celery/userguide/monitoring.html#django-admin-monitor, saves tasks details in django model in nice graphical way.
Comments
Post a Comment