Skip to content

Commit

Permalink
add poolMode configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Feb 21, 2024
1 parent 7648494 commit ccd8a1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface GetTestPostgresDatabaseFactoryOptions<
pgbouncer?: {
enabled: boolean
version?: string
poolMode?: "session" | "transaction"
}

/**
Expand Down
10 changes: 2 additions & 8 deletions src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ccd8a1a

Please sign in to comment.