diff --git a/lib/tasks/cognigy/index.js b/lib/tasks/cognigy/index.js index b016a6a3..146e75e3 100644 --- a/lib/tasks/cognigy/index.js +++ b/lib/tasks/cognigy/index.js @@ -51,7 +51,7 @@ class Cognigy extends Task { this.timeoutCount = 0; // create a task queue so we can execute our taskss subsequently // also executing tasks whenever they come in - this.taskQueue = queue({concurrency: 1, autostart: true}); + this.taskQueue = queue({concurrency: 1, autostart: 1}); } get name() { return TaskName.Cognigy; } @@ -225,7 +225,8 @@ class Cognigy extends Task { async _onBotFinalPing(cs, ep) { this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing'); - this.gatherTask = this._makeGatherTask({textPrompt: ""}); + await this.taskQueue.lastPromise; + this.gatherTask = this._makeGatherTask({textPrompt: "this should be changed"}); this.gatherTask.exec(cs, ep, this) .catch((err) => this.logger.info({err}, 'Cognigy gather task returned error')); this.prompts = [];