From ae27c83dc488c60b5097491dcac74c842994564d Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Sat, 28 Jun 2025 18:23:46 +1000 Subject: [PATCH] feat(ui): log when cancelation fails --- invokeai/frontend/web/src/services/api/run-graph.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/invokeai/frontend/web/src/services/api/run-graph.ts b/invokeai/frontend/web/src/services/api/run-graph.ts index 206027bd93..0823313a7e 100644 --- a/invokeai/frontend/web/src/services/api/run-graph.ts +++ b/invokeai/frontend/web/src/services/api/run-graph.ts @@ -1,6 +1,7 @@ import { logger } from 'app/logging/logger'; import type { AppStore } from 'app/store/store'; import { withResult, withResultAsync } from 'common/util/result'; +import { parseify } from 'common/util/serialize'; import { getPrefixedId } from 'features/controlLayers/konva/util'; import type { Graph } from 'features/nodes/util/graph/generation/Graph'; import type { S } from 'services/api/types'; @@ -175,7 +176,9 @@ export const runGraph = (arg: RunGraphArg): Promise => { log.trace('Graph canceled by timeout'); cleanup(); if (queueItemId !== null) { - dependencies.executor.cancelQueueItem(queueItemId); + dependencies.executor.cancelQueueItem(queueItemId).catch((error) => { + log.warn({ error: parseify(error) }, 'Failed to cancel queue item during timeout'); + }); } reject(new Error('Graph timed out')); }, timeout); @@ -193,7 +196,9 @@ export const runGraph = (arg: RunGraphArg): Promise => { log.trace('Graph canceled by signal'); cleanup(); if (queueItemId !== null) { - dependencies.executor.cancelQueueItem(queueItemId); + dependencies.executor.cancelQueueItem(queueItemId).catch((error) => { + log.warn({ error: parseify(error) }, 'Failed to cancel queue item during abort'); + }); } reject(new Error('Graph canceled')); };