Skip to content

Commit

Permalink
Merge pull request #3088 from WikiWatershed/tt/protect-against-celery…
Browse files Browse the repository at this point in the history
…-failures

Protect Against Celery Failures

Connects #2982
  • Loading branch information
rajadain committed Feb 21, 2019
2 parents ab0389e + d400d7d commit b392627
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/mmw/apps/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ def save_job_error(request, exc, traceback, job_id):
try:
job = Job.objects.get(id=job_id)
job.error = exc
job.traceback = traceback
job.traceback = traceback or 'No traceback'
job.delivered_at = now()
job.status = 'failed'
job.save()
except Exception as e:
logger.error('Failed to save job error status. Job will appear hung. \
Job Id: {0}'.format(job.id))
logger.error('Error number: {0} - Error: {1}'
.format(e.errno, e.strerror))
logger.error('Error: {}'.format(e))


@shared_task(bind=True)
Expand Down

0 comments on commit b392627

Please sign in to comment.