Comparing version 1.0.1 to 1.0.2
@@ -63,9 +63,10 @@ var genericPool = require('generic-pool') | ||
client.release = function (err) { | ||
delete client.release | ||
if (err) { | ||
this.log('release client. error:', err) | ||
this.log('destroy client. error:', err) | ||
this.pool.destroy(client) | ||
} else { | ||
this.log('release client') | ||
this.pool.release(client) | ||
} | ||
this.log('release client') | ||
delete client.release | ||
this.pool.release(client) | ||
}.bind(this) | ||
@@ -72,0 +73,0 @@ |
{ | ||
"name": "pg-pool", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Connection pool for node-postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -92,3 +92,14 @@ var expect = require('expect.js') | ||
it('recovers from all errors', co.wrap(function * () { | ||
var pool = new Pool({ poolSize: 9 }) | ||
var pool = new Pool({ | ||
poolSize: 9, | ||
log: function (str, level) { | ||
// Custom logging function to ensure we are not causing errors or warnings | ||
// inside the `generic-pool` library. | ||
if (level === 'error' || level === 'warn') { | ||
expect().fail('An error or warning was logged from the generic pool library.\n' + | ||
'Level: ' + level + '\n' + | ||
'Message: ' + str + '\n') | ||
} | ||
} | ||
}) | ||
var count = 0 | ||
@@ -95,0 +106,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
13253
200