feat: add connection check logging for PostgreSQL pools

This commit is contained in:
Giuseppe Raffa
2026-04-14 12:31:12 +02:00
parent 1ef9160361
commit e003770187

View File

@@ -74,11 +74,13 @@ async function remove(table, condition, params, type = 'users') {
async function checkPostgres() {
const status = {};
console.log("Checking PostgreSQL connections with config:", config);
for (const [name, pool] of Object.entries(pools)) {
try {
await pool.query('SELECT NOW()');
status[name] = 'connected';
} catch (error) {
console.log(`PostgreSQL connection check failed for ${name}:`, error.message);
status[name] = 'disconnected';
}
}