From 87f2d04dddcf9d9ffac665974c5b3b8256268e39 Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Mon, 20 May 2024 15:22:10 +1000 Subject: [PATCH] fix(events): fix session processor event handling --- .../session_processor/session_processor_default.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/invokeai/app/services/session_processor/session_processor_default.py b/invokeai/app/services/session_processor/session_processor_default.py index e3bc25a841..b7198831ba 100644 --- a/invokeai/app/services/session_processor/session_processor_default.py +++ b/invokeai/app/services/session_processor/session_processor_default.py @@ -10,6 +10,7 @@ from invokeai.app.services.events.events_common import ( FastAPIEvent, QueueClearedEvent, QueueEventBase, + QueueItemStatusChangedEvent, SessionCanceledEvent, register_events, ) @@ -89,11 +90,7 @@ class DefaultSessionProcessor(SessionProcessorBase): self._poll_now() elif isinstance(payload, BatchEnqueuedEvent): self._poll_now() - elif event_name == "queue_item_status_changed" and event[1]["data"]["queue_item"]["status"] in [ - "completed", - "failed", - "canceled", - ]: + elif isinstance(payload, QueueItemStatusChangedEvent) and payload.status in ("completed", "failed", "canceled"): self._poll_now() def resume(self) -> SessionProcessorStatus: