MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / get_project_pids

Method get_project_pids

class/projectModel/pythonModel.py:1112–1123  ·  view source on GitHub ↗

@name 获取项目进程pid列表 @author baozi<2021-08-10> @param pid: int 主进程pid @return list

(pid)

Source from the content-addressed store, hash-verified

1110
1111 @staticmethod
1112 def get_project_pids(pid):
1113 """
1114 @name 获取项目进程pid列表
1115 @author baozi<2021-08-10>
1116 @param pid: int 主进程pid
1117 @return list
1118 """
1119 try:
1120 p = psutil.Process(pid)
1121 return [p.pid] + [c.pid for c in p.children(recursive=True) if p.status() != psutil.STATUS_ZOMBIE]
1122 except:
1123 return []
1124
1125 def get_project_run_state(self, project_name):
1126 ''&#x27;

Callers 2

get_project_run_stateMethod · 0.95
__stop_projectMethod · 0.95

Calls 2

childrenMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected