express-myconnection
express-myconnection copied to clipboard
If client connections drops then the mysql connection is leaked.
I am implementing long polling in express and my clients can timeout and drop the connection.
In this case the connection is leaked using request strategy. I've solved in my long polling code with:
req.on('close', function(err) {
req.getConnection(function(err, connection) {
connection.end();
});
});
I fixed this bug on this basis and published it to npm
npm install express-my-connection
github: express-mysql-connection
npm: express-mysql-connection