From d0e7ad792928ed6f35dd752084b417ab95293d05 Mon Sep 17 00:00:00 2001 From: Naseem <24660299+naseemkullah@users.noreply.github.com> Date: Sat, 18 Sep 2021 15:23:05 -0400 Subject: [PATCH] remove unused reference heart beat timeout --- packages/tracing/src/idletransaction.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/tracing/src/idletransaction.ts b/packages/tracing/src/idletransaction.ts index bb0494da6570..eb71680e0732 100644 --- a/packages/tracing/src/idletransaction.ts +++ b/packages/tracing/src/idletransaction.ts @@ -55,9 +55,6 @@ export class IdleTransaction extends Transaction { // Activities store a list of active spans public activities: Record = {}; - // Stores reference to the timeout that calls _beat(). - private _heartbeatTimer: number = 0; - // Track state of activities in previous heartbeat private _prevHeartbeatString: string | undefined; @@ -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(); } @@ -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; @@ -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); } }