node-pool icon indicating copy to clipboard operation
node-pool copied to clipboard

Add a maximum age of object in pool

Open pstonham opened this issue 3 years ago • 2 comments

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.

pstonham avatar Jan 06 '23 15:01 pstonham

Amazing ! I was just looking for this and had to implement it using the validate()

matthieusieben avatar Jan 27 '23 12:01 matthieusieben

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.

matthieusieben avatar Jan 27 '23 12:01 matthieusieben