Only limit connections for reads

This commit is contained in:
Ajay 2022-11-12 15:44:09 -05:00
parent d3d53d0758
commit a417299d3e

View file

@ -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");
}