mysqljs/mysql

It would be good to add some idleTimeout to pool options

Open

#962 创建于 2014年12月18日

在 GitHub 查看
 (9 评论) (5 反应) (0 负责人)JavaScript (18,137 star) (2,502 fork)batch import
featurehelp wanted

描述

Hello,

I am using this module for a long time but it lacks one failsafe element. My code for database functions became very big and it is hard to find where connection is not closed or if some errors happened before connection is closed that connection will stay idle and eventually when all are consumed from the pool the application hangs on database calls. It would be good to add some option like idelConnectionTimeout that will destroy a connection from a pool if it is idle for set time. This way pool will never stuck and will create fresh connections to replace those that hanged. Also if some mechanism could be made to auto close connection on end that would be great but i think that is not an option...

贡献者指南

It would be good to add some idleTimeout to pool options · mysqljs/mysql#962 | Good First Issue