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 (#15868)
  • Loading branch information
Hackatosh committed Apr 9, 2023
1 parent 9d864be commit 58576dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dialects/postgres/connection-manager.js
Expand Up @@ -203,7 +203,7 @@ class ConnectionManager extends AbstractConnectionManager {
});

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

0 comments on commit 58576dd

Please sign in to comment.