Description
The Node.js Express backend connects to PostgreSQL using pg.Pool inside config.ts.
Problem
If the local PostgreSQL database server restarts, experiences connection timeouts, or drops temporarily, active queries on the pool will fail, and some routes do not automatically try to re-establish the pool state, requiring a manual process restart.
Proposed Action Items
- Add error listeners to the database pool (
pool.on('error', ...)).
- Implement a graceful re-connection loop with exponential backoff if the database connection is lost.
Description
The Node.js Express backend connects to PostgreSQL using
pg.Poolinsideconfig.ts.Problem
If the local PostgreSQL database server restarts, experiences connection timeouts, or drops temporarily, active queries on the pool will fail, and some routes do not automatically try to re-establish the pool state, requiring a manual process restart.
Proposed Action Items
pool.on('error', ...)).