Skip to content

Commit 2ccf0c4

Browse files
committed
pool size can be pass via configuration
1 parent a19e72e commit 2ccf0c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ PG.prototype.connect = function(config, callback) {
4343

4444
if(pool) return pool.acquire(cb);
4545

46+
var poolSize = defaults.poolSize;
47+
if (c.poolSize) {
48+
poolSize = c.poolSize;
49+
}
4650
var pool = pools[poolName] = genericPool.Pool({
4751
name: poolName,
4852
create: function(callback) {
@@ -75,7 +79,7 @@ PG.prototype.connect = function(config, callback) {
7579
destroy: function(client) {
7680
client.end();
7781
},
78-
max: defaults.poolSize,
82+
max: poolSize,
7983
idleTimeoutMillis: defaults.poolIdleTimeout,
8084
reapIntervalMillis: defaults.reapIntervalMillis
8185
});

0 commit comments

Comments
 (0)