Update asyncio
This commit is contained in:
parent
f2575e04fb
commit
704adf6fe8
@ -33,9 +33,8 @@ class BaseMapper:
|
|||||||
self.db.commit()
|
self.db.commit()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
result = _execute()
|
|
||||||
async with self.semaphore:
|
async with self.semaphore:
|
||||||
return _execute()
|
return await asyncio.to_thread(_execute)
|
||||||
|
|
||||||
async def new(self):
|
async def new(self):
|
||||||
return self.model_class(mapper=self, app=self.app)
|
return self.model_class(mapper=self, app=self.app)
|
||||||
|
Loading…
Reference in New Issue
Block a user