mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 05:57:04 +03:00
Only limit connections for reads
This commit is contained in:
@@ -105,7 +105,7 @@ export class Postgres implements IDatabase {
|
|||||||
|
|
||||||
Logger.debug(`prepare (postgres): type: ${type}, query: ${query}, params: ${params}`);
|
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) {
|
&& this.activePostgresRequests > this.config.postgres.maxActiveRequests) {
|
||||||
throw new Error("Too many active postgres requests");
|
throw new Error("Too many active postgres requests");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user