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]>
This commit is contained in:
1 parent
803e8f36c1
commit
77931db775
5 files changed
+53
-3
No files matched your search
@@ -1,6 +1,10 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
|
||||
// Built at request time — avoids competing with SSG workers for scarce DB
|
||||
// connections during `next build` (pool timeouts killed deploy on sitemap).
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
const appUrl = process.env.APP_URL ?? "http://localhost:3000";
|
||||
|
||||
|
||||
Reference in new issue
Block a user