Skip to content

Commit d3c5c18

Browse files
committed
remove unused reference heart beat timeout
1 parent 66c47fc commit d3c5c18

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/tracing/src/idletransaction.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ export class IdleTransaction extends Transaction {
5555
// Activities store a list of active spans
5656
public activities: Record<string, boolean> = {};
5757

58-
// Stores reference to the timeout that calls _beat().
59-
private _heartbeatTimer: number = 0;
60-
6158
// Track state of activities in previous heartbeat
6259
private _prevHeartbeatString: string | undefined;
6360

@@ -185,6 +182,7 @@ export class IdleTransaction extends Transaction {
185182
this.spanRecorder = new IdleTransactionSpanRecorder(pushActivity, popActivity, this.spanId, maxlen);
186183

187184
// Start heartbeat so that transactions do not run forever.
185+
// but what about idletimeout
188186
logger.log('Starting heartbeat');
189187
this._pingHeartbeat();
190188
}
@@ -236,7 +234,6 @@ export class IdleTransaction extends Transaction {
236234
* If this occurs we finish the transaction.
237235
*/
238236
private _beat(): void {
239-
clearTimeout(this._heartbeatTimer);
240237
// We should not be running heartbeat if the idle transaction is finished.
241238
if (this._finished) {
242239
return;
@@ -267,9 +264,9 @@ export class IdleTransaction extends Transaction {
267264
*/
268265
private _pingHeartbeat(): void {
269266
logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);
270-
this._heartbeatTimer = (setTimeout(() => {
267+
setTimeout(() => {
271268
this._beat();
272-
}, 5000) as unknown) as number;
269+
}, 5000); // 5000 should be idletimeout
273270
}
274271
}
275272

0 commit comments

Comments
 (0)