Fix comfy request abort

This commit is contained in:
Cohee
2025-01-31 16:15:07 +00:00
parent 9710d88a88
commit 26030f6ee4

View File

@@ -533,6 +533,7 @@ comfy.post('/delete-workflow', jsonParser, async (request, response) => {
comfy.post('/generate', jsonParser, async (request, response) => { comfy.post('/generate', jsonParser, async (request, response) => {
try { try {
let item;
const url = new URL(urlJoin(request.body.url, '/prompt')); const url = new URL(urlJoin(request.body.url, '/prompt'));
const controller = new AbortController(); const controller = new AbortController();
@@ -557,7 +558,6 @@ comfy.post('/generate', jsonParser, async (request, response) => {
/** @type {any} */ /** @type {any} */
const data = await promptResult.json(); const data = await promptResult.json();
const id = data.prompt_id; const id = data.prompt_id;
let item;
const historyUrl = new URL(urlJoin(request.body.url, '/history')); const historyUrl = new URL(urlJoin(request.body.url, '/history'));
while (true) { while (true) {
const result = await fetch(historyUrl); const result = await fetch(historyUrl);