node-pool
node-pool copied to clipboard
Add a maximum age of object in pool
Added maxAgeMillis which if set will check the age of an object in the idle and evict if older than the value in MS.
Allows for eviction of old connections even if they've been used recently.
Amazing ! I was just looking for this and had to implement it using the validate()
Note that the effective value for evictionRunIntervalMillis should probably be something like Math.min(evictionRunIntervalMillis, maxAgeMillis) to avoid keeping overage resources alive for too long.