mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
no more busyloops in stub plugins
This commit is contained in:
@@ -104,6 +104,11 @@ def run_sync(coro: Coroutine[Any, Any, _RetvalT]) -> _RetvalT:
|
||||
return asyncio.get_event_loop().run_until_complete(coro)
|
||||
|
||||
|
||||
# =====
|
||||
async def wait_infinite() -> None:
|
||||
await asyncio.get_event_loop().create_future()
|
||||
|
||||
|
||||
# =====
|
||||
@contextlib.asynccontextmanager
|
||||
async def unlock_only_on_exception(lock: asyncio.Lock) -> AsyncGenerator[None, None]:
|
||||
|
||||
Reference in New Issue
Block a user