From ccd8a1a542844f15644cf32c47b65419525f69e4 Mon Sep 17 00:00:00 2001 From: Severin Ibarluzea Date: Wed, 21 Feb 2024 11:49:45 -0800 Subject: [PATCH] add poolMode configuration --- src/public-types.ts | 1 + src/worker.ts | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/public-types.ts b/src/public-types.ts index 5402171..49223e4 100644 --- a/src/public-types.ts +++ b/src/public-types.ts @@ -42,6 +42,7 @@ export interface GetTestPostgresDatabaseFactoryOptions< pgbouncer?: { enabled: boolean version?: string + poolMode?: "session" | "transaction" } /** diff --git a/src/worker.ts b/src/worker.ts index 06433d0..4539186 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -327,15 +327,9 @@ export class Worker { .withName(getRandomDatabaseName()) .withEnvironment({ DATABASE_URL: connectionString, - // PGBOUNCER_LISTEN_PORT: "6432", - POOL_MODE: "transaction", + POOL_MODE: + this.initialData.pgbouncerOptions?.poolMode ?? "transaction", LISTEN_PORT: "6432", - // PGBOUNCER_MAX_CLIENT_CONN: "1000", - // PGBOUNCER_DEFAULT_POOL_SIZE: "1000", - // PGBOUNCER_SERVER_IDLE_TIMEOUT: "240", - // PGBOUNCER_SERVER_CONNECT_TIMEOUT: "15", - // PGBOUNCER_QUERY_TIMEOUT: "240", - // PGBOUNCER_QUERY_WAIT_TIMEOUT: "240", }) .withStartupTimeout(120_000) .withNetwork(network)