@@ -71,7 +71,7 @@ export class IdleTransaction extends Transaction {
71
71
* If a transaction is created and no activities are added, we want to make sure that
72
72
* it times out properly. This is cleared and not used when activities are added.
73
73
*/
74
- private _initTimeout : ReturnType < typeof setTimeout > | undefined ;
74
+ private _idleTimeout : ReturnType < typeof setTimeout > | undefined ;
75
75
76
76
public constructor (
77
77
transactionContext : TransactionContext ,
@@ -80,7 +80,7 @@ export class IdleTransaction extends Transaction {
80
80
* The time to wait in ms until the idle transaction will be finished.
81
81
* @default 1000
82
82
*/
83
- private readonly _idleTimeout : number = DEFAULT_IDLE_TIMEOUT ,
83
+ private readonly _idleTimeoutDuration : number = DEFAULT_IDLE_TIMEOUT ,
84
84
// Whether or not the transaction should put itself on the scope when it starts and pop itself off when it ends
85
85
private readonly _onScope : boolean = false ,
86
86
) {
@@ -96,11 +96,11 @@ export class IdleTransaction extends Transaction {
96
96
_idleHub . configureScope ( scope => scope . setSpan ( this ) ) ;
97
97
}
98
98
99
- this . _initTimeout = setTimeout ( ( ) => {
99
+ this . _idleTimeout = setTimeout ( ( ) => {
100
100
if ( ! this . _finished ) {
101
101
this . finish ( ) ;
102
102
}
103
- } , this . _idleTimeout ) ;
103
+ } , this . _idleTimeoutDuration ) ;
104
104
}
105
105
106
106
/** {@inheritDoc } */
@@ -194,9 +194,9 @@ export class IdleTransaction extends Transaction {
194
194
* @param spanId The span id that represents the activity
195
195
*/
196
196
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 ;
200
200
}
201
201
logger . log ( `[Tracing] pushActivity: ${ spanId } ` ) ;
202
202
this . activities [ spanId ] = true ;
@@ -216,15 +216,15 @@ export class IdleTransaction extends Transaction {
216
216
}
217
217
218
218
if ( Object . keys ( this . activities ) . length === 0 ) {
219
- const timeout = this . _idleTimeout ;
219
+ const timeout = this . _idleTimeoutDuration ;
220
220
// We need to add the timeout here to have the real endtimestamp of the transaction
221
221
// Remember timestampWithMs is in seconds, timeout is in ms
222
222
const end = timestampWithMs ( ) + timeout / 1000 ;
223
223
224
- if ( this . _initTimeout ) {
225
- clearTimeout ( this . _initTimeout ) ;
224
+ if ( this . _idleTimeout ) {
225
+ clearTimeout ( this . _idleTimeout ) ;
226
226
}
227
- this . _initTimeout = setTimeout ( ( ) => {
227
+ this . _idleTimeout = setTimeout ( ( ) => {
228
228
if ( ! this . _finished ) {
229
229
this . setTag ( FINISH_REASON_TAG , IDLE_TRANSACTION_FINISH_REASONS [ 1 ] ) ;
230
230
this . finish ( end ) ;
0 commit comments