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

Method kill_pids

class/projectModel/javaModel.py:3440–3456  ·  view source on GitHub ↗

@name 结束进程列表 @author hwliang<2021-08-10> @param pids: string<进程pid列表> @return dict

(self, get=None, pids=None)

Source from the content-addressed store, hash-verified

3438 return public.returnMsg(True, msg, project_id)
3439
3440 def kill_pids(self, get=None, pids=None):
3441 ''&#x27;
3442 @name 结束进程列表
3443 @author hwliang<2021-08-10>
3444 @param pids: string<进程pid列表>
3445 @return dict
3446 ''&#x27;
3447 if get: pids = get.pids
3448 if not pids: return public.returnMsg(True, '没有进程')
3449 pids = sorted(pids, reverse = True)
3450 for i in pids:
3451 try:
3452 p = psutil.Process(i)
3453 p.terminate()
3454 except:
3455 pass
3456 return public.returnMsg(True, '进程已全部结束')
3457
3458 def get_project_list2(self, get):
3459 ''&#x27;

Callers 2

stop_projectMethod · 0.95

Calls 1

returnMsgMethod · 0.80

Tested by

no test coverage detected