MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / stop

Method stop

core/embed_server.py:130–157  ·  view source on GitHub ↗

Stop the embed server subprocess.

(self)

Source from the content-addressed store, hash-verified

128 return False
129
130 def stop(self):
131 """Stop the embed server subprocess."""
132 if self.process:
133 try:
134 import signal as _signal
135 if os.name != "nt":
136 try:
137 os.killpg(os.getpgid(self.process.pid), _signal.SIGTERM)
138 except ProcessLookupError:
139 self.process.terminate()
140 else:
141 self.process.terminate()
142 try:
143 self.process.wait(timeout=5)
144 except subprocess.TimeoutExpired:
145 try:
146 os.killpg(os.getpgid(self.process.pid), _signal.SIGKILL)
147 except Exception:
148 self.process.kill()
149 except Exception:
150 try:
151 self.process.kill()
152 except Exception:
153 pass
154 finally:
155 self.process = None
156 self._started = False
157 info("Embed server stopped")
158
159 def is_running(self) -> bool:
160 if self.process is not None and self.process.poll() is None:

Callers 2

startMethod · 0.95
stop_embed_serverFunction · 0.45

Calls 1

infoFunction · 0.90

Tested by

no test coverage detected