From 90600f2b47eec4df9aa5e3078c2700b6e759bf42 Mon Sep 17 00:00:00 2001 From: twisha16 Date: Tue, 7 Jun 2016 17:05:55 -0400 Subject: [PATCH] Adding returnToHead in clientConfig param (#1007) --- lib/defaults.js | 3 +++ lib/pool.js | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/defaults.js b/lib/defaults.js index 3b37e36..19195c8 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -33,6 +33,9 @@ var defaults = module.exports = { //frequency to check for idle clients within the client pool reapIntervalMillis: 1000, + //if true the most recently released resources will be the first to be allocated + returnToHead: false, + //pool log function / boolean poolLog: false, diff --git a/lib/pool.js b/lib/pool.js index d05a16f..7e51f48 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -22,6 +22,7 @@ module.exports = function(Client) { max: clientConfig.poolSize || defaults.poolSize, idleTimeoutMillis: clientConfig.poolIdleTimeout || defaults.poolIdleTimeout, reapIntervalMillis: clientConfig.reapIntervalMillis || defaults.reapIntervalMillis, + returnToHead: clientConfig.returnToHead || defaults.returnToHead, log: clientConfig.poolLog || defaults.poolLog, create: function(cb) { var client = new pools.Client(clientConfig);