Cognigy / Cognigy-CLI

Cognigy-CLI is a series of tools meant to aid Cognigy.AI developers in maintaining local copies of their virtual agent projects.
Other
7 stars 6 forks source link

UnhandledPromiseRejection: [...] The promise rejected with the reason "Timeout" #130

Closed tgbv closed 7 months ago

tgbv commented 11 months ago

I received the below error after executing the following command:

cognigy train flow "flow_name"
Training intents for locale DE ... \node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Timeout".] {
code: 'ERR_UNHANDLED_REJECTION'
}

A. The default timeout of 10 seconds is very small. For one flow locale with many intents Cognigy NLU needs more time to build them. I believe it should be raised to at least 5 minutes.

B. The bigger problem is that function src/utils/checks.checkTask is not optimal. The interval in which CLI pools Cognigy API for task status is directly dependent on the timeout value. That means if I set the timeout value to 10 minutes, a flow with 0 intents will block the CLI process at least two minutes - reference. Another issue with it is that it limits the nr of pooling trials to 5, also constrained by the timeout value.

XavierJordaMurria commented 11 months ago

Hi, yes, you are right, that would need to be refactored. Maybe you could create a feature request so we could get some time to work on this.