Skip to content

Commit

Permalink
check if connection is closed in reset callback
Browse files Browse the repository at this point in the history
updated .gitignore
updated docs
  • Loading branch information
ben-page committed Jun 16, 2016
1 parent 65c23bf commit 08d277c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ npm-debug.log
node_modules/
*.sublime-*
.idea/
/test.js
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ Release the connect back to the pool to be used again

## Changelog

### Version 1.0.3
* bug fix only

### Version 1.0.3
* Pool modifies the Tedious connection object rather than the Connection prototype.

Expand Down
3 changes: 3 additions & 0 deletions lib/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ ConnectionPool.prototype.release = function(connection) {
if (pooled.con === connection) {
//reset connection & release it
connection.reset(function (err) {
if (!pooled.con) //the connection failed during the reset
return;

if (err) { //there is an error, don't reuse the connection, just close it
pooled.con.close();
return;
Expand Down

0 comments on commit 08d277c

Please sign in to comment.