@name 结束进程列表 @author hwliang<2021-08-10> @param pids: string<进程pid列表> @return dict
(self, get=None, pids=None)
| 3438 | return public.returnMsg(True, msg, project_id) |
| 3439 | |
| 3440 | def kill_pids(self, get=None, pids=None): |
| 3441 | ''' |
| 3442 | @name 结束进程列表 |
| 3443 | @author hwliang<2021-08-10> |
| 3444 | @param pids: string<进程pid列表> |
| 3445 | @return dict |
| 3446 | ''' |
| 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 | ''' |
no test coverage detected