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() {
|
async function checkPostgres() {
|
||||||
const status = {};
|
const status = {};
|
||||||
|
console.log("Checking PostgreSQL connections with config:", config);
|
||||||
for (const [name, pool] of Object.entries(pools)) {
|
for (const [name, pool] of Object.entries(pools)) {
|
||||||
try {
|
try {
|
||||||
await pool.query('SELECT NOW()');
|
await pool.query('SELECT NOW()');
|
||||||
status[name] = 'connected';
|
status[name] = 'connected';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(`PostgreSQL connection check failed for ${name}:`, error.message);
|
||||||
status[name] = 'disconnected';
|
status[name] = 'disconnected';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user