Skip to content

Use optional pool parameters in connection object #445

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

Closed
markselby opened this issue Sep 18, 2013 · 3 comments
Closed

Use optional pool parameters in connection object #445

markselby opened this issue Sep 18, 2013 · 3 comments

Comments

@markselby
Copy link

Using grunt to read a config/database.yml, I've added connection pool options.

var conn = grunt.file.readYAML('config/database.yml')[process.env.NODE_ENV];

defaults: &defaults
host: localhost
username: mark
password: whatever
idle: 30000
reap: 1000

development:
<<: *defaults
database: whatever_development
min: 10
max: 50

production:
host: production.host

database: whatever_production

In lib/pool.js the changes are just ......

pool = genericPool.Pool({
name: name,
min: clientConfig.min || defaults.poolSize,
max: clientConfig.max || defaults.poolSize,
idleTimeoutMillis: clientConfig.idle || defaults.poolIdleTimeout,

reapIntervalMillis: clientConfig.reap || defaults.reapIntervalMillis,

Fancy adding that?

@brianc
Copy link
Owner

brianc commented Sep 18, 2013

yeah definitely - I don't see why it would hurt to override any/all of the pooling configuration with user specified values in the config (not just in defaults)

@BeeDi
Copy link

BeeDi commented Apr 17, 2015

👍

@brianc
Copy link
Owner

brianc commented Jun 21, 2016

Much of this will be possible once #1049 lands later this week

@brianc brianc closed this as completed Jun 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants