fixed bargin task loop forever (#1253)

This commit is contained in:
Hoan Luu Huu
2025-06-22 11:20:24 +07:00
committed by GitHub
parent 3f11ee58a7
commit 8c67c05d87

View File

@@ -139,7 +139,11 @@ class TaskGather extends SttTask {
try {
await this.handling(cs, obj);
} catch (error) {
if (error instanceof SpeechCredentialError) {
if (
// avoid bargein task with sticky will restart forever
// throw exception to stop the loop.
!this.sticky &&
error instanceof SpeechCredentialError) {
this.logger.info('Gather failed due to SpeechCredentialError, finished!');
this.notifyTaskDone();
return;