feat: add connection check logging for PostgreSQL pools
This commit is contained in:
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user