coopernurse / node-pool

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

don't call _scheduleRemoveIdle if refreshIdle is falsy #151

Closed mikemorris closed 7 years ago

mikemorris commented 8 years ago

Avoids spending unnecessary time in Pool.prototype._scheduleRemoveIdle and Pool.prototype._removeIdle when idle objects will never be removed.

sandfox commented 7 years ago

The wording/intent around refreshIdle is very not-clear. Whilst it seems like it is a toggle for deciding if to refresh idle instances, what it's really for is deciding if we should refresh idle instances that part of the "min pool" size count.

I've changed the docs a little recently to try and reflect that better but there is probably still more that could be done.