Skip to content

Commit 2c1958a

Browse files
committed
Correctly handle deno deploy timeouts
1 parent 073930f commit 2c1958a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

apps/webapp/app/models/endpoint.server.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ export function detectResponseIsTimeout(rawBody: string, response?: Response) {
2525
return false;
2626
}
2727

28-
if (isResponseVercelTimeout(response)) {
29-
return true;
30-
}
31-
32-
return isResponseCloudflareTimeout(rawBody, response);
28+
return (
29+
isResponseVercelTimeout(response) ||
30+
isResponseDenoDeployTimeout(rawBody, response) ||
31+
isResponseCloudflareTimeout(rawBody, response)
32+
);
3333
}
3434

3535
function isResponseCloudflareTimeout(rawBody: string, response: Response) {
@@ -46,3 +46,7 @@ function isResponseVercelTimeout(response: Response) {
4646
response.headers.get("x-vercel-error") === "FUNCTION_INVOCATION_TIMEOUT"
4747
);
4848
}
49+
50+
function isResponseDenoDeployTimeout(rawBody: string, response: Response) {
51+
return response.status === 502 && rawBody.includes("TIME_LIMIT");
52+
}

0 commit comments

Comments
 (0)