Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for connectionLifetime option #67

Open
shamasis opened this issue Nov 18, 2017 · 0 comments
Open

Feature Request: Support for connectionLifetime option #67

shamasis opened this issue Nov 18, 2017 · 0 comments

Comments

@shamasis
Copy link
Member

shamasis commented Nov 18, 2017

The idea is to destroy a connection from a pool once it has stayed connected for a specified duration of time.

  • we need to accept this option
  • we need to listen to the connection event in pool and set the current time in it
  • listen to the release event of pool and check if current time is - created time is > lifetime option.
  • if yes to above, then do connection.destroy()

Ref:
mysqljs/mysql#1872 (API to destroy)
https://github.com/mysqljs/mysql#pool-events (Pool Events)
https://github.com/postmanlabs/sails-mysql-transactions/blob/develop/lib/db.js (module where the read-only pool cluster is created)
https://github.com/postmanlabs/sails-mysql/tree/master-postman/lib/connections (location where writeable pools are created)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant