We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94eb37c commit ee56a8dCopy full SHA for ee56a8d
src/databases/Postgres.ts
@@ -138,8 +138,12 @@ export class Postgres implements IDatabase {
138
if (lastPool === this.pool) {
139
// Only applies if it is get or all request
140
options.forceReplica = true;
141
- } else if (lastPool === this.poolRead && maxTries() - tries <= 1) {
142
- options.useReplica = false;
+ } else if (lastPool === this.poolRead) {
+ this.lastPoolReadFail = Date.now();
143
+
144
+ if (maxTries() - tries <= 1) {
145
+ options.useReplica = false;
146
+ }
147
}
148
149
Logger.error(`prepare (postgres) try ${tries}: ${err}`);
0 commit comments