From 111976bea548c95cceb9cedf3e0a726225917750 Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Fri, 28 Jun 2024 08:54:36 -0400 Subject: [PATCH] bug: clear asr timer when gather resolves with timeout (#788) --- lib/tasks/gather.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tasks/gather.js b/lib/tasks/gather.js index 4a810d79..a9fca80a 100644 --- a/lib/tasks/gather.js +++ b/lib/tasks/gather.js @@ -570,7 +570,10 @@ class TaskGather extends SttTask { } _clearAsrTimer() { - if (this._asrTimer) clearTimeout(this._asrTimer); + if (this._asrTimer) { + this.logger.debug('_clearAsrTimer: asrTimer cleared'); + clearTimeout(this._asrTimer); + } this._asrTimer = null; } @@ -1010,6 +1013,8 @@ class TaskGather extends SttTask { clearTimeout(this.interDigitTimer); this._clearTimer(); this._clearFastRecognitionTimer(); + this._clearAsrTimer(); + this._clearFinalAsrTimer(); this.span.setAttributes({ channel: 1,