Skip to content

Commit

Permalink
simplify boolean logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 27, 2023
1 parent 10f1ab9 commit b44cdd9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/tracing/idletransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,9 @@ export class IdleTransaction extends Transaction {

const spanStartedBeforeTransactionFinish = span.startTimestamp < endTimestamp;

// Add a delta with idle timeout so that we prevent false positives
const timeoutWithDelta = (this._finalTimeout + this._idleTimeout) / 1000;

const transactionDidNotExceedTimeout = endTimestamp - this.startTimestamp < timeoutWithDelta;
const spanDidNotExceedTimeout = span.endTimestamp - span.startTimestamp < timeoutWithDelta;
const spanEndedBeforeFinalTimeout = transactionDidNotExceedTimeout && spanDidNotExceedTimeout;
const spanEndedBeforeFinalTimeout = span.endTimestamp - this.startTimestamp < timeoutWithDelta;

if (__DEBUG_BUILD__) {
const stringifiedSpan = JSON.stringify(span, undefined, 2);
Expand Down

0 comments on commit b44cdd9

Please sign in to comment.