Update.
This commit is contained in:
parent
097889ba3f
commit
bde3819510
@ -24,11 +24,7 @@ class BaseMapper:
|
|||||||
return asyncio.get_event_loop()
|
return asyncio.get_event_loop()
|
||||||
|
|
||||||
async def run_in_executor(self, func, *args, **kwargs):
|
async def run_in_executor(self, func, *args, **kwargs):
|
||||||
def call():
|
return await self.loop.run_in_executor(None, lambda: func(*args, **kwargs))
|
||||||
return func(*args, **kwargs)
|
|
||||||
return await self.loop.run_in_executor(None, call)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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