FoalTS / foal

Full-featured Node.js framework 🚀
https://foalts.org/
MIT License
1.9k stars 142 forks source link

Multiple mysql "active" connections #1201

Closed lcnvdl closed 1 year ago

lcnvdl commented 1 year ago

Version of FoalTS: 2.9.0

image

Hi! I've been testing my foal-ts microservices on a kind of "production" environment. I'm connecting each service with a MySQL database.

The problem is the next: There are lots of open connections to the database (now I have 57 connections after reboot the server), when in reality few services (7) are running.

I'm using FoalTS with Typeorm.

Thanks in advance.

LoicPoullain commented 1 year ago

I feel like connections are not closed when the server shuts down. Maybe the solution would be to add something like process.on('exit', () => myConnection.close()) ?

LoicPoullain commented 1 year ago

I'm closing this issue as there as has been no activity since the last message. Feel free to comment back if you still need help on this. 👍