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

Method write_pid

mod/project/python/serviceMod.py:105–111  ·  view source on GitHub ↗
(self, pid: int)

Source from the content-addressed store, hash-verified

103 self.env = env
104
105 def write_pid(self, pid: int):
106 if not self.env:
107 raise RuntimeError('未设置环境')
108 pid_file = os.path.join(SERVICE_PATH, '{}/{}.pid'.format(self.env.project_name, self.name))
109 if not os.path.isdir(os.path.dirname(pid_file)):
110 os.makedirs(os.path.dirname(pid_file), 0o755)
111 public.writeFile(pid_file, str(pid))
112
113 def read_pid(self) -> Optional[int]:
114 if not self.env:

Callers 1

get_service_pidMethod · 0.95

Calls 4

dirnameMethod · 0.80
writeFileMethod · 0.80
joinMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected