Don't crash on postgres errors

This commit is contained in:
Ajay
2022-06-24 17:20:48 -04:00
parent e1d6fdfefb
commit a8d0336cae

View File

@@ -21,6 +21,9 @@ export class Postgres implements IDatabase {
async init(): Promise<void> { async init(): Promise<void> {
this.pool = new Pool(this.config.postgres); this.pool = new Pool(this.config.postgres);
this.pool.on("error", (err) => {
Logger.error(err.stack);
});
if (!this.config.readOnly) { if (!this.config.readOnly) {
if (this.config.createDbIfNotExists) { if (this.config.createDbIfNotExists) {