feat: implement comprehensive health check endpoints for API, Auth, and Realtime services to monitor database, Redis, MinIO, and InfluxDB connectivity.

This commit is contained in:
Giuseppe Raffa
2026-04-04 12:10:00 +02:00
parent ba6941fd2a
commit b31a04b1a7
10 changed files with 106 additions and 8 deletions

View File

@@ -70,10 +70,24 @@ async function remove(table, condition, params, type = 'users') {
const sql = `DELETE FROM ${table} WHERE ${condition}`;
return await query(sql, params, type);
}
async function checkPostgres() {
const status = {};
for (const [name, pool] of Object.entries(pools)) {
try {
await pool.query('SELECT NOW()');
status[name] = 'connected';
} catch (error) {
status[name] = 'disconnected';
}
}
return status;
}
module.exports = {
query,
append,
remove,
getClient,
checkPostgres,
pools
};