diff --git a/packages/db/src/serverless.ts b/packages/db/src/serverless.ts index d071a8d6e..66f0708dc 100644 --- a/packages/db/src/serverless.ts +++ b/packages/db/src/serverless.ts @@ -2,10 +2,6 @@ import type postgres from "postgres"; import { createDatabase, createPool } from "./create"; -const MAX_POOL = 1; -const IDLE_TIMEOUT = 10000; // 10 seconds -const CONNECT_TIMEOUT = 1000; // 1 seconds - const globalForPool = globalThis as unknown as { pool: ReturnType | undefined; }; @@ -14,19 +10,11 @@ let pool; if (process.env.NODE_ENV !== "production") { if (!globalForPool.pool) { - globalForPool.pool = createPool({ - max: MAX_POOL, - idle_timeout: IDLE_TIMEOUT, - connect_timeout: CONNECT_TIMEOUT, - }); + globalForPool.pool = createPool(); } pool = globalForPool.pool; } else { - pool = createPool({ - max: MAX_POOL, - idle_timeout: IDLE_TIMEOUT, - connect_timeout: CONNECT_TIMEOUT, - }); + pool = createPool(); } export const db = createDatabase(pool);