mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-11 22:17:14 +03:00
Don't kill program if can't connect to read server
This commit is contained in:
@@ -53,6 +53,7 @@ export class Postgres implements IDatabase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (this.config.postgresReadOnly && this.config.postgresReadOnly.enabled) {
|
if (this.config.postgresReadOnly && this.config.postgresReadOnly.enabled) {
|
||||||
|
try {
|
||||||
this.poolRead = new Pool({
|
this.poolRead = new Pool({
|
||||||
...this.config.postgresReadOnly
|
...this.config.postgresReadOnly
|
||||||
});
|
});
|
||||||
@@ -66,6 +67,9 @@ export class Postgres implements IDatabase {
|
|||||||
Logger.error(`poolRead (postgres): ${err}`);
|
Logger.error(`poolRead (postgres): ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
Logger.error(`poolRead (postgres): ${e}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.config.readOnly) {
|
if (!this.config.readOnly) {
|
||||||
|
|||||||
Reference in New Issue
Block a user