Bot commited on
Commit
8f7768e
·
1 Parent(s): 98c5c6c

Cap database connection pool size at 3 to respect Aiven connections ceiling

Browse files
Files changed (1) hide show
  1. src/lib/db/pg/db.pg.ts +2 -0
src/lib/db/pg/db.pg.ts CHANGED
@@ -4,6 +4,8 @@ import { Pool } from "pg";
4
  const pool = new Pool({
5
  connectionString: process.env.POSTGRES_URL,
6
  ssl: { rejectUnauthorized: false },
 
 
7
  });
8
 
9
  export const pgDb = drizzlePg({ client: pool });
 
4
  const pool = new Pool({
5
  connectionString: process.env.POSTGRES_URL,
6
  ssl: { rejectUnauthorized: false },
7
+ max: 3,
8
+ idleTimeoutMillis: 300000,
9
  });
10
 
11
  export const pgDb = drizzlePg({ client: pool });