MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / kill_all_related_processes

Method kill_all_related_processes

lightx2v/utils/service_utils.py:18–30  ·  view source on GitHub ↗

Kill the current process and all its child processes

()

Source from the content-addressed store, hash-verified

16class ProcessManager:
17 @staticmethod
18 def kill_all_related_processes():
19 """Kill the current process and all its child processes"""
20 current_process = psutil.Process()
21 children = current_process.children(recursive=True)
22 for child in children:
23 try:
24 child.kill()
25 except Exception as e:
26 logger.info(f"Failed to kill child process {child.pid}: {e}")
27 try:
28 current_process.kill()
29 except Exception as e:
30 logger.info(f"Failed to kill main process: {e}")
31
32 @staticmethod
33 def signal_handler(sig, frame):

Callers 1

signal_handlerMethod · 0.80

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected