Add more logging detail when _health endpoint fails

This commit is contained in:
Tom Moor
2023-06-25 16:13:58 -04:00
parent 7940cef517
commit e58163ef5f

View File

@@ -93,13 +93,17 @@ async function start(id: number, disconnect: () => void) {
try {
await sequelize.query("SELECT 1");
} catch (err) {
throw new Error("Database connection failed");
Logger.error("Database connection failed", err);
ctx.status = 500;
return;
}
try {
await RedisAdapter.defaultClient.ping();
} catch (err) {
throw new Error("Redis ping failed");
Logger.error("Redis ping failed", err);
ctx.status = 500;
return;
}
ctx.body = "OK";