fix: use customer db url with password for pgbouncer health check
All checks were successful
Build & Release / build (push) Successful in 13s

This commit is contained in:
Ryan Moon
2026-04-03 22:12:42 -05:00
parent 4ebb31f21a
commit 70bc894e45

View File

@@ -240,9 +240,11 @@ export async function customerRoutes(app: FastifyInstance) {
await sql.end();
}
})(),
// Try connecting via pgbouncer
// Try connecting via pgbouncer using the customer's db url from k8s secret
(async () => {
const sql = postgres(`postgresql://${slug}@${PGBOUNCER_HOST}:${PGBOUNCER_PORT}/${slug}`, { max: 1, connect_timeout: 5 });
const secrets = await getSecret(namespace, "lunarfront-secrets").catch(() => null);
if (!secrets?.["database-url"]) return false;
const sql = postgres(secrets["database-url"], { max: 1, connect_timeout: 5 });
try {
await sql`SELECT 1`;
return true;