mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Add timeout for write too
This commit is contained in:
@@ -37,7 +37,10 @@ export class Postgres implements IDatabase {
|
|||||||
constructor(private config: DatabaseConfig) {}
|
constructor(private config: DatabaseConfig) {}
|
||||||
|
|
||||||
async init(): Promise<void> {
|
async init(): Promise<void> {
|
||||||
this.pool = new Pool(this.config.postgres);
|
this.pool = new Pool({
|
||||||
|
...this.config.postgres,
|
||||||
|
statement_timeout: 25000
|
||||||
|
});
|
||||||
this.pool.on("error", (err, client) => {
|
this.pool.on("error", (err, client) => {
|
||||||
Logger.error(err.stack);
|
Logger.error(err.stack);
|
||||||
this.lastPoolFail = Date.now();
|
this.lastPoolFail = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user