How do I know if a celery task has crashed?

21 views
Skip to first unread message

Mike

unread,
Jan 28, 2014, 3:06:07 AM1/28/14
to django...@googlegroups.com
I have a model that looks something like this:

Job(models.Model):
    status = models.CharField(max_length=8, choices = statuses)
    jobid = models.CharField(max_length=20, db_index=True)
    ...

I submit tasks to celery.  The task fetches the Job object, changes its status to RUNNING, does the computation, then changes the status to FINISHED.  If the job crashes in my code I can catch the exception, set the status to ERROR and act accordingly, but if it crashes for some other reason I won't know it.  The only thing I can think of is to stop the celery queue, let it drain, and check the Job table for objects set to RUNNING.  Seems janky to me.  Is there a better way?
Reply all
Reply to author
Forward
0 new messages