Skip to content

Commit

Permalink
closes #56 - idle resources below the "min" value are no longer destr…
Browse files Browse the repository at this point in the history
…oyed
  • Loading branch information
Will Shaver committed Dec 14, 2012
1 parent edc20bb commit 196e558
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generic-pool.js
Expand Up @@ -158,7 +158,7 @@ exports.Pool = function (factory) {


// Go through the available (idle) items, // Go through the available (idle) items,
// check if they have timed out // check if they have timed out
for (i = 0, al = availableObjects.length; i < al; i += 1) { for (i = 0, al = availableObjects.length; i < al && (count - factory.min) > toRemove.length ; i += 1) {
timeout = availableObjects[i].timeout; timeout = availableObjects[i].timeout;
if (now >= timeout) { if (now >= timeout) {
// Client timed out, so destroy it. // Client timed out, so destroy it.
Expand Down

0 comments on commit 196e558

Please sign in to comment.