MCPcopy Create free account
hub / github.com/1jehuang/jcode / stop_server

Function stop_server

scripts/benchmark_discovery.py:592–606  ·  view source on GitHub ↗
(args: argparse.Namespace, socket_path: Path, process: subprocess.Popen[str])

Source from the content-addressed store, hash-verified

590
591
592def stop_server(args: argparse.Namespace, socket_path: Path, process: subprocess.Popen[str]) -> None:
593 try:
594 try:
595 subprocess.run(
596 [args.jcode, "--socket", str(socket_path), "server", "stop"],
597 capture_output=True,
598 text=True,
599 env=benchmark_environment(socket_path),
600 timeout=20,
601 )
602 except subprocess.TimeoutExpired:
603 pass
604 terminate_process(process)
605 finally:
606 socket_path.unlink(missing_ok=True)
607
608
609def summarize_case(case: BenchmarkCase, trials: list[dict[str, Any]]) -> dict[str, Any]:

Callers 1

mainFunction · 0.85

Calls 3

benchmark_environmentFunction · 0.85
terminate_processFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected