Skip to content

Commit ac5c6d1

Browse files
committed
fix
1 parent 261ef0b commit ac5c6d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

sentry_sdk/_span_batcher.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ def add(self, span: "StreamedSpan") -> None:
5656
# _add_to_envelope during flush, or _flush_event.wait/set) triggers
5757
# a GC-emitted warning that routes back through the logging
5858
# integration into add().
59-
6059
if getattr(self._active, "flag", False):
6160
return None
6261

6362
self._active.flag = True
6463

65-
if not self._ensure_thread() or self._flusher is None:
66-
return None
67-
6864
try:
65+
if not self._ensure_thread() or self._flusher is None:
66+
return None
67+
6968
with self._lock:
7069
size = len(self._span_buffer[span.trace_id])
7170
if size >= self.MAX_BEFORE_DROP:

0 commit comments

Comments
 (0)