Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
436 B
TypeScript
19 lines
436 B
TypeScript
import pg from "pg";
|
|
import { config } from "./config.js";
|
|
|
|
export const pool = new pg.Pool({
|
|
connectionString: config.postgres.connectionString,
|
|
max: 10,
|
|
idleTimeoutMillis: 30_000,
|
|
connectionTimeoutMillis: 5_000,
|
|
});
|
|
|
|
/** Quick health check — resolves true if DB responds. */
|
|
export async function pgHealthy(): Promise<boolean> {
|
|
try {
|
|
await pool.query("SELECT 1");
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|