mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-22 01:27:55 +00:00
further fix for race condition in #206
This commit is contained in:
@@ -191,6 +191,10 @@ class TaskGather extends Task {
|
|||||||
if (this.input.includes('speech') && !this.listenDuringPrompt) {
|
if (this.input.includes('speech') && !this.listenDuringPrompt) {
|
||||||
this._initSpeech(cs, ep)
|
this._initSpeech(cs, ep)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
if (this.killed) {
|
||||||
|
this.logger.info('Gather:exec - task was quickly killed so do not transcribe');
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._startTranscribing(ep);
|
this._startTranscribing(ep);
|
||||||
return updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid);
|
return updateSpeechCredentialLastUsed(this.sttCredentials.speech_credential_sid);
|
||||||
})
|
})
|
||||||
@@ -223,7 +227,13 @@ class TaskGather extends Task {
|
|||||||
if (!this.killed) startListening(cs, ep);
|
if (!this.killed) startListening(cs, ep);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else startListening(cs, ep);
|
else {
|
||||||
|
if (this.killed) {
|
||||||
|
this.logger.info('Gather:exec - task was immediately killed so do not transcribe');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startListening(cs, ep);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.input.includes('speech') && this.listenDuringPrompt) {
|
if (this.input.includes('speech') && this.listenDuringPrompt) {
|
||||||
await this._initSpeech(cs, ep);
|
await this._initSpeech(cs, ep);
|
||||||
|
|||||||
Reference in New Issue
Block a user