exec gather after finishing queue

This commit is contained in:
akirilyuk
2022-02-02 20:25:52 +01:00
parent baed1b0eac
commit e579514321

View File

@@ -241,15 +241,15 @@ class Cognigy extends Task {
async _onBotFinalPing(cs, ep) { async _onBotFinalPing(cs, ep) {
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing'); this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
this._enqueueTask(async() => { try {
// lets wait until we have finished processing the speech before
// starting a gather...
await this.taskQueue.lastPromise;
const gatherTask = this._makeGatherTask(); const gatherTask = this._makeGatherTask();
await gatherTask.exec(cs, ep, this); await gatherTask.exec(cs, ep, this);
try { } catch (err) {
await sayTask.exec(cs, ep, this); this.logger.info({err}, 'Cognigy gather task returned error');
} catch (err) { }
this.logger.info({err}, 'Cognigy gather task returned error');
}
});
} }
async _onBotUtterance(cs, ep, evt) { async _onBotUtterance(cs, ep, evt) {