Comparing version 2.0.0 to 2.0.1
19
index.js
@@ -19,3 +19,3 @@ 'use strict' | ||
client.release = throwOnRelease | ||
if (err) { | ||
if (err || this.ending) { | ||
this._remove(client) | ||
@@ -32,10 +32,6 @@ this._pulseQueue() | ||
this._remove(client) | ||
}, this.idleTimeoutMillis) | ||
}, this.options.idleTimeoutMillis) | ||
} | ||
if (this.ending) { | ||
this._remove(client) | ||
} else { | ||
this._idle.push(new IdleItem(client, tid)) | ||
} | ||
this._idle.push(new IdleItem(client, tid)) | ||
this._pulseQueue() | ||
@@ -69,2 +65,6 @@ } | ||
if (typeof this.options.idleTimeoutMillis === 'undefined') { | ||
this.options.idleTimeoutMillis = 10000 | ||
} | ||
this._clients = [] | ||
@@ -120,3 +120,6 @@ this._idle = [] | ||
_remove (client) { | ||
this._idle = this._idle.filter(item => item.client !== client) | ||
this._idle = this._idle.filter(item => { | ||
clearTimeout(item.timeoutId) | ||
return item.client !== client | ||
}) | ||
this._clients = this._clients.filter(c => c !== client) | ||
@@ -123,0 +126,0 @@ client.end() |
{ | ||
"name": "pg-pool", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Connection pool for node-postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,10 +20,10 @@ # pg-pool | ||
//by default the pool uses the same | ||
//configuration as whatever `pg` version you have installed | ||
// by default the pool uses the same | ||
// configuration as whatever `pg` version you have installed | ||
var pool = new Pool() | ||
//you can pass properties to the pool | ||
//these properties are passed unchanged to both the node-postgres Client constructor | ||
//and the node-pool (https://github.com/coopernurse/node-pool) constructor | ||
//allowing you to fully configure the behavior of both | ||
// you can pass properties to the pool | ||
// these properties are passed unchanged to both the node-postgres Client constructor | ||
// and the node-pool (https://github.com/coopernurse/node-pool) constructor | ||
// allowing you to fully configure the behavior of both | ||
var pool2 = new Pool({ | ||
@@ -35,5 +35,6 @@ database: 'postgres', | ||
ssl: true, | ||
max: 20, //set pool max size to 20 | ||
min: 4, //set min pool size to 4 | ||
idleTimeoutMillis: 1000 //close idle clients after 1 second | ||
max: 20, // set pool max size to 20 | ||
min: 4, // set min pool size to 4 | ||
idleTimeoutMillis: 1000, // close idle clients after 1 second | ||
connectionTimeoutMillis: 1000, // return an error after 1 second if connection could not be established | ||
}) | ||
@@ -40,0 +41,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42672
914
352
1