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

Method get_operation_info

mod/project/java/groupMod.py:328–341  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

326
327 # 获取可操作状态的信息
328 def get_operation_info(self) -> Tuple[Iterable[str], str]:
329 pid_file = "{}/{}.pid".format(Group.GROUP_TMP_DIR, self.group_id)
330 try:
331 pid = int(public.readFile(pid_file))
332 p = psutil.Process(pid)
333 if not p.is_running():
334 return ("start", "stop"), ""
335 else:
336 last_cmd = p.cmdline()[-2] if len(p.cmdline()) == 4 else ""
337 return ("termination",), last_cmd
338
339 except:
340 pass
341 return ("start", "stop"), ""
342
343 def group_info(self, project_cache: Optional[dict] = None) -> Optional[dict]:
344 if not self.config:

Callers 1

group_infoMethod · 0.95

Calls 3

readFileMethod · 0.80
formatMethod · 0.45
is_runningMethod · 0.45

Tested by

no test coverage detected