fix: use customer db url with password for pgbouncer health check
All checks were successful
Build & Release / build (push) Successful in 13s
All checks were successful
Build & Release / build (push) Successful in 13s
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user