From eaadc55c7dc133903469dbc0c995b753a23f6c98 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 16 Apr 2024 16:55:56 -0400 Subject: [PATCH] make pause/resume work in multithreaded environment --- .../app/services/session_processor/session_processor_default.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/invokeai/app/services/session_processor/session_processor_default.py b/invokeai/app/services/session_processor/session_processor_default.py index 1860e4a5b3..02860f46f1 100644 --- a/invokeai/app/services/session_processor/session_processor_default.py +++ b/invokeai/app/services/session_processor/session_processor_default.py @@ -181,7 +181,9 @@ class DefaultSessionProcessor(SessionProcessorBase): while True: # Outer try block. Any error here is a fatal processor error try: + self._resume_event.wait() session = self._session_worker_queue.get() + if self._cancel_event.is_set(): if session.item_id in self._sessions_to_cancel: continue