Merge pull request #2638 from pikasTech/fix/2614-harnessrl-source-artifact
Pipelines as Code CI / hwlab-nc01-v03-ci-poll- Success
Pipelines as Code CI / hwlab-nc01-v03-ci-poll- Success
fix: 兼容 HarnessRL PostgreSQL SSL 模式
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user