@@ -55,9 +55,6 @@ export class IdleTransaction extends Transaction {
55
55
// Activities store a list of active spans
56
56
public activities : Record < string , boolean > = { } ;
57
57
58
- // Stores reference to the timeout that calls _beat().
59
- private _heartbeatTimer : number = 0 ;
60
-
61
58
// Track state of activities in previous heartbeat
62
59
private _prevHeartbeatString : string | undefined ;
63
60
@@ -185,6 +182,7 @@ export class IdleTransaction extends Transaction {
185
182
this . spanRecorder = new IdleTransactionSpanRecorder ( pushActivity , popActivity , this . spanId , maxlen ) ;
186
183
187
184
// Start heartbeat so that transactions do not run forever.
185
+ // but what about idletimeout
188
186
logger . log ( 'Starting heartbeat' ) ;
189
187
this . _pingHeartbeat ( ) ;
190
188
}
@@ -236,7 +234,6 @@ export class IdleTransaction extends Transaction {
236
234
* If this occurs we finish the transaction.
237
235
*/
238
236
private _beat ( ) : void {
239
- clearTimeout ( this . _heartbeatTimer ) ;
240
237
// We should not be running heartbeat if the idle transaction is finished.
241
238
if ( this . _finished ) {
242
239
return ;
@@ -267,9 +264,9 @@ export class IdleTransaction extends Transaction {
267
264
*/
268
265
private _pingHeartbeat ( ) : void {
269
266
logger . log ( `pinging Heartbeat -> current counter: ${ this . _heartbeatCounter } ` ) ;
270
- this . _heartbeatTimer = ( setTimeout ( ( ) => {
267
+ setTimeout ( ( ) => {
271
268
this . _beat ( ) ;
272
- } , 5000 ) as unknown ) as number ;
269
+ } , 5000 ) ;
273
270
}
274
271
}
275
272
0 commit comments