Commit e42374d0 by Cory Lee Committed by Cory Lee

Dont

parent 41b51d08
...@@ -8,8 +8,11 @@ from django.db import DatabaseError, connection, transaction ...@@ -8,8 +8,11 @@ from django.db import DatabaseError, connection, transaction
from django.http import Http404, JsonResponse from django.http import Http404, JsonResponse
from django.shortcuts import redirect from django.shortcuts import redirect
from django.views.generic import View from django.views.generic import View
from course_discovery.apps.core.constants import Status from course_discovery.apps.core.constants import Status
try:
import newrelic.agent
except ImportError: # pragma: no cover
newrelic = None # pylint: disable=invalid-name
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
User = get_user_model() User = get_user_model()
...@@ -32,7 +35,8 @@ def health(_): ...@@ -32,7 +35,8 @@ def health(_):
>>> response.content >>> response.content
'{"overall_status": "OK", "detailed_status": {"database_status": "OK"}}' '{"overall_status": "OK", "detailed_status": {"database_status": "OK"}}'
""" """
if newrelic: # pragma: no cover
newrelic.agent.ignore_transaction()
try: try:
cursor = connection.cursor() cursor = connection.cursor()
cursor.execute("SELECT 1") cursor.execute("SELECT 1")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment