express-myconnection icon indicating copy to clipboard operation
express-myconnection copied to clipboard

If client connections drops then the mysql connection is leaked.

Open JamesWiresmith opened this issue 11 years ago • 1 comments

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();
        });
    });

JamesWiresmith avatar Oct 16 '14 13:10 JamesWiresmith

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

szyuan avatar Jun 15 '17 02:06 szyuan