Fix health DB connectivity probe

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-03-30 13:17:34 -05:00
parent db4e146551
commit 88e742a129
2 changed files with 54 additions and 3 deletions

View file

@ -29,6 +29,17 @@ export function healthRoutes(
return;
}
try {
await db.execute(sql`SELECT 1`);
} catch {
res.status(503).json({
status: "unhealthy",
version: serverVersion,
error: "database_unreachable",
});
return;
}
let bootstrapStatus: "ready" | "bootstrap_pending" = "ready";
let bootstrapInviteActive = false;
if (opts.deploymentMode === "authenticated") {