Skip to content

Commit

Permalink
change fetch request timeouts to 20 hours from 300s
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnrushefsky committed Jan 21, 2025
1 parent 1342e22 commit 69e57d1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "comfyui-api",
"version": "1.8.0",
"version": "1.8.1",
"description": "Wraps comfyui to make it easier to use as a stateless web service",
"main": "dist/src/index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/comfy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export async function warmupComfyUI(): Promise<void> {
"Content-Type": "application/json",
},
body: JSON.stringify({ prompt: config.warmupPrompt }),
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 hours
});
if (!resp.ok) {
throw new Error(`Failed to warmup Comfy UI: ${await resp.text()}`);
Expand Down
3 changes: 3 additions & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ server.after(() => {
filename,
prompt,
}),
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 hours
})
.catch((e: any) => {
app.log.error(
Expand Down Expand Up @@ -376,6 +377,7 @@ server.after(() => {
prompt,
error: e.message,
}),
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 hours
});

if (!resp.ok) {
Expand Down Expand Up @@ -495,6 +497,7 @@ server.after(() => {
"Content-Type": "application/json",
},
body: JSON.stringify({ prompt, id, webhook, convert_output }),
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 hours
}
);
const body = await resp.json();
Expand Down
2 changes: 1 addition & 1 deletion test/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export async function submitPrompt(
"Content-Type": "application/json",
},
body: JSON.stringify(body),
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 minutes
signal: AbortSignal.timeout(1000 * 60 * 60 * 20), // 20 hours
});
if (!resp.ok) {
console.error(await resp.text());
Expand Down

0 comments on commit 69e57d1

Please sign in to comment.