Skip to content

Commit 639318f

Browse files
consistently early exit
1 parent 5efa060 commit 639318f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

sentry_sdk/tracing_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,11 +382,10 @@ def add_query_source(
382382
Adds OTel compatible source code information to a database query span
383383
"""
384384
client = sentry_sdk.get_client()
385+
if not client.is_active():
386+
return
385387

386388
if isinstance(span, LegacySpan):
387-
if not client.is_active():
388-
return
389-
390389
# In the StreamedSpan case, we need to add the extra span information before
391390
# the span finishes, so it's expected that this will be None. In the LegacySpan case,
392391
# it should already be finished.

0 commit comments

Comments
 (0)