Skip to content

Commit

Permalink
Merge pull request rq#576 from jlopex/ensure_custom_handlers_are_called
Browse files Browse the repository at this point in the history
Ensure custom exception handlers call when Redis is down
  • Loading branch information
selwin committed Aug 26, 2015
2 parents 02c6df6 + 4fb59a4 commit cf20f1d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,12 @@ def perform_job(self, job):
except Exception:
job.set_status(JobStatus.FAILED, pipeline=pipeline)
started_job_registry.remove(job, pipeline=pipeline)
pipeline.execute()
try:
pipeline.execute()
except Exception:
# Ensure that custom exception handlers are called
# even if Redis is down
pass
self.handle_exception(job, *sys.exc_info())
return False

Expand Down

0 comments on commit cf20f1d

Please sign in to comment.