FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.88k stars 137 forks source link

Multiple mysql "active" connections #1201

Closed lcnvdl closed 8 months 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 8 months 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. 👍