gabrieldapaz / ticketing

E-Commerce app using Microservices built with Node, React, Docker and Kubernetes
0 stars 0 forks source link

Fix UnhandledPromiseRejectionWarning: Error: stan: publish ack timeout at Expiration Service #8

Open gabrieldapaz opened 4 years ago

gabrieldapaz commented 4 years ago

(node:45) UnhandledPromiseRejectionWarning: Error: stan: publish ack timeout [expiration-depl-64f7b7df66-rb4hg expiration] at Timeout. (/app/node_modules/node-nats-streaming/lib/stan.js:603:18) [expiration-depl-64f7b7df66-rb4hg expiration] at listOnTimeout (internal/timers.js:551:17) [expiration-depl-64f7b7df66-rb4hg expiration] at processTimers (internal/timers.js:494:7) [expiration-depl-64f7b7df66-rb4hg expiration] (node:45) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

gabrieldapaz commented 4 years ago

The error occurs when create an Order and it cannot publish an event to change the status after a certain delay time

gabrieldapaz commented 4 years ago

Because of this when you charge a client payment (test), the client always are going to be able to charge again, because the status of the order will not be Cancelled