Skip to content

Commit

Permalink
Fix auto-closing of idle connections
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksimek committed Apr 25, 2017
1 parent 6a81e5f commit b70efdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ const config = {
- **pool.min** - The minimum of connections there can be in the pool (default: `0`).
- **pool.idleTimeoutMillis** - The Number of milliseconds before closing an unused connection (default: `30000`).

Complete list of pool options can be found [here](https://github.com/coopernurse/node-pool).

### Formats

In addition to configuration object there is an option to pass config as a connection string. Two formats of connection string are supported.
Expand Down
4 changes: 2 additions & 2 deletions lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ class ConnectionPool extends EventEmitter {
}, Object.assign({
max: 10,
min: 0,
evictionRunIntervalMillis: 1000,
idleTimeoutMillis: 30000,
testOnBorrow: true,
autostart: false
testOnBorrow: true
}, this.config.pool))

this.pool.on('factoryCreateError', this.emit.bind(this, 'error'))
Expand Down

0 comments on commit b70efdb

Please sign in to comment.