Fix comfy request abort
| @@ -533,6 +533,7 @@ comfy.post('/delete-workflow', jsonParser, async (request, response) => { | |||
| 533 | 533 | ||
| 534 | comfy.post('/generate', jsonParser, async (request, response) => { | 534 | comfy.post('/generate', jsonParser, async (request, response) => { |
| 535 | try { | 535 | try { |
| 536 | let item; | ||
| 536 | const url = new URL(urlJoin(request.body.url, '/prompt')); | 537 | const url = new URL(urlJoin(request.body.url, '/prompt')); |
| 537 | 538 | ||
| 538 | const controller = new AbortController(); | 539 | const controller = new AbortController(); |
| @@ -557,7 +558,6 @@ comfy.post('/generate', jsonParser, async (request, response) => { | |||
| 557 | /** @type {any} */ | 558 | /** @type {any} */ |
| 558 | const data = await promptResult.json(); | 559 | const data = await promptResult.json(); |
| 559 | const id = data.prompt_id; | 560 | const id = data.prompt_id; |
| 560 | let item; | ||
| 561 | const historyUrl = new URL(urlJoin(request.body.url, '/history')); | 561 | const historyUrl = new URL(urlJoin(request.body.url, '/history')); |
| 562 | while (true) { | 562 | while (true) { |
| 563 | const result = await fetch(historyUrl); | 563 | const result = await fetch(historyUrl); |