mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-29 17:44:50 +00:00
Fix
This commit is contained in:
parent
308467ed1c
commit
544ff6465b
1 changed files with 2 additions and 2 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import asyncio
|
||||
|
||||
loop = asyncio.get_running_loop()
|
||||
|
||||
def asyncify(func):
|
||||
async def inner(*args, **kwargs):
|
||||
loop = asyncio.get_running_loop()
|
||||
func_out = await loop.run_in_executor(None, func, *args, **kwargs)
|
||||
return func_out
|
||||
|
||||
|
|
@ -13,6 +12,7 @@ def new_task(func):
|
|||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
try:
|
||||
loop = asyncio.get_running_loop()
|
||||
return loop.create_task(func(*args, **kwargs))
|
||||
except Exception as e:
|
||||
LOGGER.error(f"Failed to create task for {func.__name__} : {e}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue