mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
aioproc: use killpg() for SIGKILL
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
|
||||
import os
|
||||
import signal
|
||||
import asyncio
|
||||
import asyncio.subprocess
|
||||
import logging
|
||||
@@ -96,7 +97,7 @@ async def kill_process(proc: asyncio.subprocess.Process, wait: float, logger: lo
|
||||
await asyncio.sleep(wait)
|
||||
if proc.returncode is None:
|
||||
try:
|
||||
proc.kill()
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGKILL)
|
||||
except Exception:
|
||||
if proc.returncode is not None:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user