Files
Epicnabbo-Catalogus-Updated…/src/lib/prisma-pool.test.ts
T
SimoandCursor 77931db775 fix: cap Prisma pool during next build to stop deploy SSG timeouts
Next build workers were each opening up to DATABASE_POOL_SIZE connections and exhausting MySQL (pool active=0), hanging sitemap generation. Cap build pool to 5, fail connect faster, limit SSG concurrency, and make sitemap dynamic.

Co-authored-by: Cursor <[email protected]>
2026-07-21 21:28:27 +02:00

20 lines
685 B
TypeScript

import { describe, expect, it } from "vitest";
import { resolvePrismaConnectionLimit } from "./prisma-pool";
describe("resolvePrismaConnectionLimit", () => {
it("caps the pool during production build phases", () => {
expect(resolvePrismaConnectionLimit(40, "phase-production-build")).toBe(5);
expect(
resolvePrismaConnectionLimit(40, "phase-production-compile"),
).toBe(5);
expect(resolvePrismaConnectionLimit(3, "phase-production-build")).toBe(3);
});
it("keeps the configured pool outside build", () => {
expect(resolvePrismaConnectionLimit(40, undefined)).toBe(40);
expect(resolvePrismaConnectionLimit(40, "phase-development-server")).toBe(
40,
);
});
});