dbConnectionBudget reserved room for an API deploy overlap (apiReloadOverlap, BIT-31550) but not for a worker deploy overlap. PM2 startOrReload on the fork-mode photoreport-worker starts the new process before the old one finishes its 25 s drain, so both Prisma pools and both broadcasters are open at once. With defaults that is 2 * (47 + 1) + 26 = 122 > 100 max_connections, tipping Postgres into error 53300 "sorry, too many clients already". Add workerReloadOverlap (default 1) that divides the remaining budget by the number of concurrent workers, so the total stays under max_connections even during a reload. The worker's Prisma pool drops from 47 to 23 with defaults — enough for the concurrent jobs the capacity planner sizes, and the headroom and ad-hoc connection margin are preserved. Paperclip-Issue: BIT-33530
10 lines
292 B
TypeScript
10 lines
292 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
/** Pure tests. The default config migrates a database, which these do not need. */
|
|
export default defineConfig({
|
|
test: {
|
|
include: ["src/**/*.test.ts", "test/capacity.test.ts", "test/compose.test.ts"],
|
|
fileParallelism: false,
|
|
},
|
|
});
|