mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Last pool fail when timeout
This commit is contained in:
@@ -138,8 +138,12 @@ export class Postgres implements IDatabase {
|
|||||||
if (lastPool === this.pool) {
|
if (lastPool === this.pool) {
|
||||||
// Only applies if it is get or all request
|
// Only applies if it is get or all request
|
||||||
options.forceReplica = true;
|
options.forceReplica = true;
|
||||||
} else if (lastPool === this.poolRead && maxTries() - tries <= 1) {
|
} else if (lastPool === this.poolRead) {
|
||||||
options.useReplica = false;
|
this.lastPoolReadFail = Date.now();
|
||||||
|
|
||||||
|
if (maxTries() - tries <= 1) {
|
||||||
|
options.useReplica = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.error(`prepare (postgres) try ${tries}: ${err}`);
|
Logger.error(`prepare (postgres) try ${tries}: ${err}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user