@@ -71,7 +71,7 @@ export class IdleTransaction extends Transaction {
7171 * If a transaction is created and no activities are added, we want to make sure that
7272 * it times out properly. This is cleared and not used when activities are added.
7373 */
74- private _initTimeout : ReturnType < typeof setTimeout > | undefined ;
74+ private _idleTimeout : ReturnType < typeof setTimeout > | undefined ;
7575
7676 public constructor (
7777 transactionContext : TransactionContext ,
@@ -80,7 +80,7 @@ export class IdleTransaction extends Transaction {
8080 * The time to wait in ms until the idle transaction will be finished.
8181 * @default 1000
8282 */
83- private readonly _idleTimeout : number = DEFAULT_IDLE_TIMEOUT ,
83+ private readonly _idleTimeoutDuration : number = DEFAULT_IDLE_TIMEOUT ,
8484 // Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends
8585 private readonly _onScope : boolean = false ,
8686 ) {
@@ -96,11 +96,11 @@ export class IdleTransaction extends Transaction {
9696 _idleHub . configureScope ( scope => scope . setSpan ( this ) ) ;
9797 }
9898
99- this . _initTimeout = setTimeout ( ( ) => {
99+ this . _idleTimeout = setTimeout ( ( ) => {
100100 if ( ! this . _finished ) {
101101 this . finish ( ) ;
102102 }
103- } , this . _idleTimeout ) ;
103+ } , this . _idleTimeoutDuration ) ;
104104 }
105105
106106 /** {@inheritDoc } */
@@ -194,9 +194,9 @@ export class IdleTransaction extends Transaction {
194194 * @param spanId The span id that represents the activity
195195 */
196196 private _pushActivity ( spanId : string ) : void {
197- if ( this . _initTimeout ) {
198- clearTimeout ( this . _initTimeout ) ;
199- this . _initTimeout = undefined ;
197+ if ( this . _idleTimeout ) {
198+ clearTimeout ( this . _idleTimeout ) ;
199+ this . _idleTimeout = undefined ;
200200 }
201201 logger . log ( `[Tracing] pushActivity: ${ spanId } ` ) ;
202202 this . activities [ spanId ] = true ;
@@ -216,15 +216,15 @@ export class IdleTransaction extends Transaction {
216216 }
217217
218218 if ( Object . keys ( this . activities ) . length === 0 ) {
219- const timeout = this . _idleTimeout ;
219+ const timeout = this . _idleTimeoutDuration ;
220220 // We need to add the timeout here to have the real endtimestamp of the transaction
221221 // Remember timestampWithMs is in seconds, timeout is in ms
222222 const end = timestampWithMs ( ) + timeout / 1000 ;
223223
224- if ( this . _initTimeout ) {
225- clearTimeout ( this . _initTimeout ) ;
224+ if ( this . _idleTimeout ) {
225+ clearTimeout ( this . _idleTimeout ) ;
226226 }
227- this . _initTimeout = setTimeout ( ( ) => {
227+ this . _idleTimeout = setTimeout ( ( ) => {
228228 if ( ! this . _finished ) {
229229 this . setTag ( FINISH_REASON_TAG , IDLE_TRANSACTION_FINISH_REASONS [ 1 ] ) ;
230230 this . finish ( end ) ;
0 commit comments