From a417299d3eec092518f712caad53f0c2935b12bd Mon Sep 17 00:00:00 2001 From: Ajay Date: Sat, 12 Nov 2022 15:44:09 -0500 Subject: [PATCH] Only limit connections for reads --- src/databases/Postgres.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/databases/Postgres.ts b/src/databases/Postgres.ts index 5253ad1..a0b0128 100644 --- a/src/databases/Postgres.ts +++ b/src/databases/Postgres.ts @@ -105,7 +105,7 @@ export class Postgres implements IDatabase { Logger.debug(`prepare (postgres): type: ${type}, query: ${query}, params: ${params}`); - if (this.config.postgres.maxActiveRequests + if (this.config.postgres.maxActiveRequests && this.isReadQuery(type) && this.activePostgresRequests > this.config.postgres.maxActiveRequests) { throw new Error("Too many active postgres requests"); }