From 70a9b1180dc075c6037bcfe864d77f334f670185 Mon Sep 17 00:00:00 2001 From: pinks Date: Tue, 26 Sep 2023 11:52:11 +0200 Subject: [PATCH] fix: sd gen request crash --- app/generationQueue.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/generationQueue.ts b/app/generationQueue.ts index 95f210e..1903d90 100644 --- a/app/generationQueue.ts +++ b/app/generationQueue.ts @@ -199,6 +199,10 @@ async function processGenerationJob( throw new Error(`Unknown task type: ${state.task.type}`); } + // we await the promise only after it finishes + // so we need to add catch callback to not crash the process before that + responsePromise.catch(() => undefined); + // poll for progress while the generation request is pending do { const progressResponse = await workerSdClient.GET("/sdapi/v1/progress", {