mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 09:01:54 +08:00
using shield_fg()
This commit is contained in:
@@ -66,7 +66,7 @@ class ExtrasInfoSubmanager(BaseInfoSubmanager):
|
||||
return None
|
||||
finally:
|
||||
if sui is not None:
|
||||
await asyncio.shield(sui.close())
|
||||
await aiotools.shield_fg(sui.close())
|
||||
|
||||
def __get_extras_path(self, *parts: str) -> str:
|
||||
return os.path.join(self.__global_config.kvmd.info.extras, *parts)
|
||||
|
||||
@@ -101,7 +101,7 @@ class RfbClient(RfbClientStream): # pylint: disable=too-many-instance-attribute
|
||||
try:
|
||||
await aiotools.wait_first(*tasks)
|
||||
finally:
|
||||
await asyncio.shield(self.__cleanup(tasks))
|
||||
await aiotools.shield_fg(self.__cleanup(tasks))
|
||||
|
||||
async def __cleanup(self, tasks: List[asyncio.Task]) -> None:
|
||||
for task in tasks:
|
||||
|
||||
@@ -147,7 +147,7 @@ class _Client(RfbClient): # pylint: disable=too-many-instance-attributes
|
||||
fb_sender=self.__fb_sender_task_loop(),
|
||||
)
|
||||
finally:
|
||||
await asyncio.shield(self.__cleanup())
|
||||
await aiotools.shield_fg(self.__cleanup())
|
||||
|
||||
async def __cleanup(self) -> None:
|
||||
if self.__kvmd_session:
|
||||
@@ -498,7 +498,7 @@ class VncServer: # pylint: disable=too-many-instance-attributes
|
||||
except Exception:
|
||||
logger.exception("%s [entry]: Unhandled exception in client task", remote)
|
||||
finally:
|
||||
await asyncio.shield(cleanup_client(writer))
|
||||
await aiotools.shield_fg(cleanup_client(writer))
|
||||
|
||||
self.__handle_client = handle_client
|
||||
|
||||
|
||||
Reference in New Issue
Block a user