mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
aioproc: use killpg() for SIGKILL
This commit is contained in:
parent
ab92a2d708
commit
487476afe4
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user