Skip to content

Commit b49d499

Browse files
committed
pool limits added
1 parent 1fffa54 commit b49d499

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/drivers/postgres/PostgreSqlDriver.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ class PostgreSqlConnection extends BaseConnection {
290290
const key = config.host + "//" + config.database + "/" + config.user;
291291
const pgPool = await namedPool.getOrCreateAsync(key,
292292
() => {
293-
const pool = new Pool(this.config);
293+
const pool = new Pool({ ... this.config,
294+
max: 20,
295+
idleTimeoutMillis: 1000,
296+
connectionTimeoutMillis: 1000,
297+
maxUses: 7500
298+
});
294299
pool.on("error", (_error, _client) => {
295300
// do nothing...
296301
});

0 commit comments

Comments
 (0)