do not await tasks

This commit is contained in:
akirilyuk
2022-02-01 14:56:07 +01:00
parent 3164e1ea4e
commit 3c75d5a489

View File

@@ -262,7 +262,7 @@ class Cognigy extends Task {
if (evt.data) this.config.update(evt.data);
if (text) {
await this._enqueueTask((async() => {
this._enqueueTask((async() => {
this.logger.info({text}, 'received text');
const sayTask = this._makeSayTask(text);
await sayTask.exec(cs, ep, this);
@@ -274,7 +274,7 @@ class Cognigy extends Task {
try {
switch (evt.data.type) {
case 'hangup':
await this._enqueueTask((async() => {
this._enqueueTask((async() => {
const hangupTask = this._makeHangupTask(evt.data.reason);
await hangupTask.exec(cs, ep, this);
this.performAction({cognigyResult: 'hangup Succeeded'});
@@ -285,7 +285,7 @@ class Cognigy extends Task {
return;
case 'refer':
await this._enqueueTask(async() => {
this._enqueueTask(async() => {
const referTask = this._makeReferTask(evt.data.number);
await referTask.exect(cs, ep, this);
this.performAction({cognigyResult: 'refer succeeded'});