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

Method kill_pids

class/projectModel/nodejsModel.py:1461–1477  ·  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

1459 return False
1460
1461 def kill_pids(self,get=None,pids = None):
1462 ''&#x27;
1463 @name 结束进程列表
1464 @author hwliang<2021-08-10>
1465 @param pids: string<进程pid列表>
1466 @return dict
1467 ''&#x27;
1468 if get: pids = get.pids
1469 if not pids: return public.return_data(True, '没有进程')
1470 pids = sorted(pids,reverse=True)
1471 for i in pids:
1472 try:
1473 p = psutil.Process(i)
1474 p.terminate()
1475 except:
1476 pass
1477 return public.return_data(True, '进程已全部结束')
1478
1479
1480

Callers 1

stop_projectMethod · 0.95

Calls 1

return_dataMethod · 0.45

Tested by

no test coverage detected