mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
feat(app): use simpler syntax for enqueue_batch threaded execution
This commit is contained in:
@@ -103,8 +103,7 @@ class SqliteSessionQueue(SessionQueueBase):
|
||||
return cast(Union[int, None], self.__cursor.fetchone()[0]) or 0
|
||||
|
||||
async def enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult:
|
||||
loop = asyncio.get_event_loop()
|
||||
return await loop.run_in_executor(None, self._enqueue_batch, queue_id, batch, prepend)
|
||||
return await asyncio.to_thread(self._enqueue_batch, queue_id, batch, prepend)
|
||||
|
||||
def _enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user