Open negreanucalin opened 1 year ago
Found a bit of a dirty fix:
process.on('uncaughtException', async (err ) => {
if (err.message === 'Connection terminated unexpectedly') {
console.log(`Restart vertica connection`)
await verticaCon.disconnect(); // I'm calling the done() method from pool.connect()
await verticaCon.connect(); // I'm calling this.pool.connect(err: any, client: any, done: Function) => {})
}
})
I have made an express server and noticed that when the Pool is not being used for ~30 minutes an error spring up:
Stack trace
Is there a way to prevent this? (listen to an event and reconnect, disable auto-closing connections or catch and reconnect)
Dependencies:
Versions Node v16.19.0 Vertica 11