coopernurse / node-pool

Generic resource pooling for node.js
2.38k stars 259 forks source link

When max is not passed; given min is ignored #164

Closed pasupulaphani closed 7 years ago

pasupulaphani commented 7 years ago

When max is not available but min is given then set max to min.

sandfox commented 7 years ago

I think that changing the pool defaults is probably a better place to start. maybe max should be infinity and min 0 (just guessing at this point, might need to see if those values break anything)

sandfox commented 7 years ago

Actually this is by design. The documentation states

  • max: maximum number of resources to create at any given time. (default=1)
  • min: minimum number of resources to keep in pool at any given time. If this is set >= max, the pool will silently set the min to equal max. (default=0)

so if you do not set a max value but do set a min of greater than 1, it will be changed to equal max

pasupulaphani commented 7 years ago

@sandfox np