Skip to content

Commit

Permalink
ref(scope): Remove apparently unnecessary if (#3298)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
szokeasaurusrex authored Jul 17, 2024
1 parent c76168c commit 76c9c76
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sentry_sdk/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,9 +1031,8 @@ def start_transaction(

transaction._profile = profile

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

Expand Down

0 comments on commit 76c9c76

Please sign in to comment.