Skip to content

Commit 7399909

Browse files
feat(app): use simpler syntax for enqueue_batch threaded execution
1 parent c8aaf5e commit 7399909

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

invokeai/app/services/session_queue/session_queue_sqlite.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ def _get_highest_priority(self, queue_id: str) -> int:
103103
return cast(Union[int, None], self.__cursor.fetchone()[0]) or 0
104104

105105
async def enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult:
106-
loop = asyncio.get_event_loop()
107-
return await loop.run_in_executor(None, self._enqueue_batch, queue_id, batch, prepend)
106+
return await asyncio.to_thread(self._enqueue_batch, queue_id, batch, prepend)
108107

109108
def _enqueue_batch(self, queue_id: str, batch: Batch, prepend: bool) -> EnqueueBatchResult:
110109
try:

0 commit comments

Comments
 (0)