Adding returnToHead in clientConfig param (#1007)

This commit is contained in:
twisha16 2016-06-07 17:05:55 -04:00 committed by Brian C
parent 667953fd5c
commit 90600f2b47
2 changed files with 4 additions and 0 deletions

View File

@ -33,6 +33,9 @@ var defaults = module.exports = {
//frequency to check for idle clients within the client pool //frequency to check for idle clients within the client pool
reapIntervalMillis: 1000, reapIntervalMillis: 1000,
//if true the most recently released resources will be the first to be allocated
returnToHead: false,
//pool log function / boolean //pool log function / boolean
poolLog: false, poolLog: false,

View File

@ -22,6 +22,7 @@ module.exports = function(Client) {
max: clientConfig.poolSize || defaults.poolSize, max: clientConfig.poolSize || defaults.poolSize,
idleTimeoutMillis: clientConfig.poolIdleTimeout || defaults.poolIdleTimeout, idleTimeoutMillis: clientConfig.poolIdleTimeout || defaults.poolIdleTimeout,
reapIntervalMillis: clientConfig.reapIntervalMillis || defaults.reapIntervalMillis, reapIntervalMillis: clientConfig.reapIntervalMillis || defaults.reapIntervalMillis,
returnToHead: clientConfig.returnToHead || defaults.returnToHead,
log: clientConfig.poolLog || defaults.poolLog, log: clientConfig.poolLog || defaults.poolLog,
create: function(cb) { create: function(cb) {
var client = new pools.Client(clientConfig); var client = new pools.Client(clientConfig);