diff --git a/internal/harnessrl/registry.ts b/internal/harnessrl/registry.ts index e3941775..d7a278de 100644 --- a/internal/harnessrl/registry.ts +++ b/internal/harnessrl/registry.ts @@ -1,6 +1,7 @@ import pg from "pg"; import { readFile } from "node:fs/promises"; +import { buildPostgresPoolConfig, postgresSslModeFromConnectionString } from "../db/runtime-store-core.ts"; import type { ActivityResult, CaseRunEvent, CaseRunRecord, CaseRunStatus, HarnessRLRegistry, StartCaseRunInput } from "./contracts.ts"; import { terminalStatus } from "./contracts.ts"; @@ -14,7 +15,11 @@ export class PostgresHarnessRLRegistry implements HarnessRLRegistry { constructor(databaseUrl: string) { if (!databaseUrl) throw codedError("harnessrl_database_url_required", "HARNESSRL_DATABASE_URL is required"); - this.pool = new Pool({ connectionString: databaseUrl, max: 8 }); + this.pool = new Pool(buildPostgresPoolConfig({ + dbUrl: databaseUrl, + sslMode: postgresSslModeFromConnectionString(databaseUrl) ?? "disable", + poolMax: 8 + })); } ensureSchema() {