Skip to content

Commit 76c9c76

Browse files
ref(scope): Remove apparently unnecessary if (#3298)
The removed `if` statement is identical to the `if` statement immediately before. It does not seem that the code before the second `if` can modify `transaction.sampled`, so it should be safe to combine the two `if` blocks into a single block under the first `if` statement.
1 parent c76168c commit 76c9c76

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sentry_sdk/scope.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,9 +1031,8 @@ def start_transaction(
10311031

10321032
transaction._profile = profile
10331033

1034-
# we don't bother to keep spans if we already know we're not going to
1035-
# send the transaction
1036-
if transaction.sampled:
1034+
# we don't bother to keep spans if we already know we're not going to
1035+
# send the transaction
10371036
max_spans = (client.options["_experiments"].get("max_spans")) or 1000
10381037
transaction.init_span_recorder(maxlen=max_spans)
10391038

0 commit comments

Comments
 (0)