Fixed aiotools.wait_infinite()

Task was destroyed but it is pending!
task: <Task pending name='Task-12' coro=<create_deadly_task.<locals>.wrapper() running at /kvmd/aiotools.py:85> wait_for=<Future pending cb=[Task.task_wakeup()]>>
This commit is contained in:
Maxim Devaev 2022-06-14 17:52:30 +03:00
parent e050bbd725
commit 37e5118fff

View File

@ -119,7 +119,8 @@ def run_sync(coro: Coroutine[Any, Any, _RetvalT]) -> _RetvalT:
# ===== # =====
async def wait_infinite() -> None: async def wait_infinite() -> None:
await asyncio.get_event_loop().create_future() while True:
await asyncio.sleep(3600)
async def wait_first(*aws: Awaitable) -> Tuple[Set[asyncio.Task], Set[asyncio.Task]]: async def wait_first(*aws: Awaitable) -> Tuple[Set[asyncio.Task], Set[asyncio.Task]]: