Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

closes #56 - idle resources below the "min" value are no longer destr…

…oyed
  • Loading branch information...
commit 196e558c8635b0f778438b298447bbe96f9e0a44 1 parent edc20bb
@wshaver wshaver authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/generic-pool.js
View
2  lib/generic-pool.js
@@ -158,7 +158,7 @@ exports.Pool = function (factory) {
// Go through the available (idle) items,
// 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;
if (now >= timeout) {
// Client timed out, so destroy it.
Please sign in to comment.
Something went wrong with that request. Please try again.