Skip to content

Commit

Permalink
fix(postgres): prevent crash if postgres connection emits multiple er…
Browse files Browse the repository at this point in the history
…rors (#15867)

Co-authored-by: Rik Smale <13023439+WikiRik@users.noreply.github.com>
  • Loading branch information
Hackatosh and WikiRik committed Apr 19, 2023
1 parent 30a1b38 commit 42fbcc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/dialects/postgres/connection-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class PostgresConnectionManager extends AbstractConnectionManager<PgConne
});

// Don't let a Postgres restart (or error) to take down the whole app
connection.once('error', error => {
connection.on('error', (error: any) => {
connection._invalid = true;
debug(`connection error ${error.code || error.message}`);
void this.pool.destroy(connection);
Expand Down

0 comments on commit 42fbcc4

Please sign in to comment.