This commit is contained in:
Jack Robison 2020-12-03 18:25:38 -05:00
parent eab3b65629
commit 2d1c6a5402
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -159,7 +159,7 @@ class AIOSQLite:
await self.read_ready.wait() await self.read_ready.wait()
still_waiting = True still_waiting = True
if self._closing: if self._closing:
raise asyncio.CancelledError raise asyncio.CancelledError()
return await asyncio.get_event_loop().run_in_executor( return await asyncio.get_event_loop().run_in_executor(
self.reader_executor, read_only_fn, sql, parameters self.reader_executor, read_only_fn, sql, parameters
) )
@ -203,7 +203,7 @@ class AIOSQLite:
try: try:
async with self.write_lock: async with self.write_lock:
if self._closing: if self._closing:
raise asyncio.CancelledError raise asyncio.CancelledError()
return await asyncio.get_event_loop().run_in_executor( return await asyncio.get_event_loop().run_in_executor(
self.writer_executor, lambda: self.__run_transaction(fun, *args, **kwargs) self.writer_executor, lambda: self.__run_transaction(fun, *args, **kwargs)
) )
@ -240,7 +240,7 @@ class AIOSQLite:
try: try:
async with self.write_lock: async with self.write_lock:
if self._closing: if self._closing:
raise asyncio.CancelledError raise asyncio.CancelledError()
return await asyncio.get_event_loop().run_in_executor( return await asyncio.get_event_loop().run_in_executor(
self.writer_executor, self.__run_transaction_with_foreign_keys_disabled, fun, args, kwargs self.writer_executor, self.__run_transaction_with_foreign_keys_disabled, fun, args, kwargs
) )