mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Only cancel session processor if current generating queue item is cancelled
This commit is contained in:
parent
e8eb9fd533
commit
98cc9b963c
@ -70,8 +70,13 @@ class DefaultSessionProcessor(SessionProcessorBase):
|
||||
async def _on_queue_event(self, event: FastAPIEvent) -> None:
|
||||
event_name = event[1]["event"]
|
||||
|
||||
if event_name == "session_canceled" or event_name == "queue_cleared":
|
||||
# These both mean we should cancel the current session.
|
||||
|
||||
if event_name == "session_canceled" and self._queue_item\
|
||||
and self._queue_item.item_id == event[1]["data"]["queue_item_id"]:
|
||||
self._cancel_event.set()
|
||||
self._poll_now()
|
||||
elif event_name == "queue_cleared" and self._queue_item\
|
||||
and self._queue_item.queue_id == event[1]["data"]["queue_id"]:
|
||||
self._cancel_event.set()
|
||||
self._poll_now()
|
||||
elif event_name == "batch_enqueued":
|
||||
|
Loading…
Reference in New Issue
Block a user