Patch next.js to allow 30 seconds image opt timeout for enka.cards
This commit is contained in:
@@ -16,6 +16,7 @@ WORKDIR /home/container
|
||||
# && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY package*.json bun.lock ./
|
||||
COPY patches ./patches
|
||||
|
||||
# Install into cache, then persist into real node_modules
|
||||
RUN --mount=type=cache,target=/root/.bun bun install --frozen-lockfile
|
||||
|
||||
@@ -98,6 +98,9 @@
|
||||
"@prisma/client",
|
||||
"prisma",
|
||||
],
|
||||
"patchedDependencies": {
|
||||
"[email protected]": "patches/[email protected]",
|
||||
},
|
||||
"overrides": {
|
||||
"@types/react": "19.2.7",
|
||||
"@types/react-dom": "19.2.3",
|
||||
|
||||
+4
-1
@@ -113,5 +113,8 @@
|
||||
"esbuild",
|
||||
"prisma",
|
||||
"sharp"
|
||||
]
|
||||
],
|
||||
"patchedDependencies": {
|
||||
"[email protected]": "patches/[email protected]"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
diff --git a/dist/esm/server/image-optimizer.js b/dist/esm/server/image-optimizer.js
|
||||
index 4e5a96e6d28492deddccbe360286c07c3035ddd5..fe0bccd10557255071c3ad07653cb46e03bd1335 100644
|
||||
--- a/dist/esm/server/image-optimizer.js
|
||||
+++ b/dist/esm/server/image-optimizer.js
|
||||
@@ -701,7 +701,7 @@ export async function fetchExternalImage(href, dangerouslyAllowLocalIP, count =
|
||||
}
|
||||
}
|
||||
const res = await fetch(href, {
|
||||
- signal: AbortSignal.timeout(7000),
|
||||
+ signal: AbortSignal.timeout(30000),
|
||||
redirect: 'manual'
|
||||
}).catch((err)=>err);
|
||||
if (res instanceof Error) {
|
||||
diff --git a/dist/server/image-optimizer.js b/dist/server/image-optimizer.js
|
||||
index 6eba3828d11590c9b1901eae3fd15289d19a492a..2fabb65cc55eb633db550bc572a0e578c24ba05b 100644
|
||||
--- a/dist/server/image-optimizer.js
|
||||
+++ b/dist/server/image-optimizer.js
|
||||
@@ -817,7 +817,7 @@ async function fetchExternalImage(href, dangerouslyAllowLocalIP, count = 3) {
|
||||
}
|
||||
}
|
||||
const res = await fetch(href, {
|
||||
- signal: AbortSignal.timeout(7000),
|
||||
+ signal: AbortSignal.timeout(30000),
|
||||
redirect: 'manual'
|
||||
}).catch((err)=>err);
|
||||
if (res instanceof Error) {
|
||||
Reference in New Issue
Block a user