Fix bug in nyasync where it would use the asyncio event loop set at function define time
This commit is contained in:
parent
52245b1256
commit
33be49d2d3
@ -2,8 +2,8 @@ import asyncio
|
||||
|
||||
def ify(func):
|
||||
"""Decorate func to run async in default executor"""
|
||||
asyncloop = asyncio.get_event_loop()
|
||||
async def asyncified(*args, **kwargs):
|
||||
asyncloop = asyncio.get_event_loop()
|
||||
return await asyncloop.run_in_executor(
|
||||
None, lambda: func(*args, **kwargs))
|
||||
return asyncified
|
||||
|
Loading…
Reference in New Issue
Block a user