Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Add setting check for instrumenting celery #1076

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion raven/contrib/django/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def __init__(self, client=client):
else:
self.has_celery = celery.VERSION >= (2, 5)

self.instrument_celery = getattr(settings, 'SENTRY_INSTRUMENT_CELERY', True)
self.celery_handler = None

def install_celery(self):
Expand All @@ -181,7 +182,7 @@ def install(self):
request_started.connect(self.before_request, weak=False)
got_request_exception.connect(self.exception_handler, weak=False)

if self.has_celery:
if self.has_celery and self.instrument_celery:
try:
self.install_celery()
except Exception:
Expand Down