Skip to content

Commit

Permalink
remove unused reference heart beat timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
naseemkullah committed Sep 18, 2021
1 parent 66c47fc commit d0e7ad7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions packages/tracing/src/idletransaction.ts
Expand Up @@ -55,9 +55,6 @@ export class IdleTransaction extends Transaction {
// Activities store a list of active spans
public activities: Record<string, boolean> = {};

// Stores reference to the timeout that calls _beat().
private _heartbeatTimer: number = 0;

// Track state of activities in previous heartbeat
private _prevHeartbeatString: string | undefined;

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

// Start heartbeat so that transactions do not run forever.
// but what about idletimeout
logger.log('Starting heartbeat');
this._pingHeartbeat();
}
Expand Down Expand Up @@ -236,7 +234,6 @@ export class IdleTransaction extends Transaction {
* If this occurs we finish the transaction.
*/
private _beat(): void {
clearTimeout(this._heartbeatTimer);
// We should not be running heartbeat if the idle transaction is finished.
if (this._finished) {
return;
Expand Down Expand Up @@ -267,9 +264,9 @@ export class IdleTransaction extends Transaction {
*/
private _pingHeartbeat(): void {
logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`);
this._heartbeatTimer = (setTimeout(() => {
setTimeout(() => {
this._beat();
}, 5000) as unknown) as number;
}, 5000);
}
}

Expand Down

0 comments on commit d0e7ad7

Please sign in to comment.