diff --git a/lib/Pool.js b/lib/Pool.js index f60a70e6..284d8ccd 100644 --- a/lib/Pool.js +++ b/lib/Pool.js @@ -305,6 +305,13 @@ class Pool extends EventEmitter { return } const minShortfall = this._config.min - this._count + + if(minShortfall == 0){ + const waiting = this._waitingClients.size(); + if(waiting > 0){ + minShortFall = diff = Math.min(waiting, this._config.max - this._count); + } + } for (let i = 0; i < minShortfall; i++) { this._createResource() }