weyoss / redis-smq

A simple high-performance Redis message queue for Node.js.
MIT License
596 stars 64 forks source link

consumeAsync doesn't handle connection error #116

Open koa202405 opened 1 week ago

koa202405 commented 1 week ago

Version: redis-smq@7.2.3

await consumer.consumeAsync(qname, handler); // This function won't block
console.log("Register consumer successfully");

If connection error happens such as Redis connection lost and command aborted, main thread will crash, I have no idea to catch such Errors

Update I find that ERROR Event will directly throw an Error which is an unhandled rejection, causing crash. Actually, redis client has a retry strategy, I think ERROR Event is not necessary