Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sentry_sdk/integrations/rq.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from rq.timeouts import JobTimeoutException
from rq.version import VERSION as RQ_VERSION
from rq.worker import Worker
from rq.job import JobStatus
except ImportError:
raise DidNotEnable("RQ not installed")

Expand Down Expand Up @@ -95,7 +96,9 @@ def sentry_patched_perform_job(self, job, *args, **kwargs):

def sentry_patched_handle_exception(self, job, *exc_info, **kwargs):
# type: (Worker, Any, *Any, **Any) -> Any
if job.is_failed:
# Note, the order of the `or` here is important,
# because calling `job.is_failed` will change `_status`.
if job._status == JobStatus.FAILED or job.is_failed:
_capture_exception(exc_info) # type: ignore

return old_handle_exception(self, job, *exc_info, **kwargs)
Expand Down