mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
wip
This commit is contained in:
@@ -87,7 +87,7 @@ class TaskTranscribe extends SttTask {
|
|||||||
|
|
||||||
async exec(cs, obj) {
|
async exec(cs, obj) {
|
||||||
try {
|
try {
|
||||||
this.hasFallbackAsrFromLastRun = cs.hasFallbackAsr;
|
this.hasFallbackAsrFromStart = cs.hasFallbackAsr;
|
||||||
await this.handling(cs, obj);
|
await this.handling(cs, obj);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof SpeechCredentialError) {
|
if (error instanceof SpeechCredentialError) {
|
||||||
@@ -913,12 +913,17 @@ class TaskTranscribe extends SttTask {
|
|||||||
isHandledByPrimaryProvider = this.isHandledByPrimaryProviderForEp2;
|
isHandledByPrimaryProvider = this.isHandledByPrimaryProviderForEp2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isOneOfEndpointAlreadyFallenBack =
|
||||||
|
this.isHandledByPrimaryProviderForEp1 !== this.isHandledByPrimaryProviderForEp2;
|
||||||
|
|
||||||
// fallback is configured
|
// fallback is configured
|
||||||
return this.fallbackVendor &&
|
return this.fallbackVendor &&
|
||||||
// has this endpoint already fallen back
|
// has this endpoint already fallen back
|
||||||
isHandledByPrimaryProvider &&
|
isHandledByPrimaryProvider &&
|
||||||
// in global level, is there any fallback is already happened
|
// in global level, is there any fallback is already happened
|
||||||
!this.hasFallbackAsrFromLastRun;
|
// one fallen endpoint will mark cs.hasFallbackAsr to true,
|
||||||
|
// so the other endpoint will be able to fallback again
|
||||||
|
(isOneOfEndpointAlreadyFallenBack || !this.cs.hasFallbackAsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
_initFallback(ep) {
|
_initFallback(ep) {
|
||||||
|
|||||||
Reference in New Issue
Block a user