MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / run

Function run

nodedb/src/ctl/healthcheck.rs:27–35  ·  view source on GitHub ↗

Run the healthcheck. Returns process exit code: - `0` — `/health` returned 2xx - `1` — connection / I/O / non-2xx

(port: u16)

Source from the content-addressed store, hash-verified

25/// - `0` — `/health` returned 2xx
26/// - `1` — connection / I/O / non-2xx
27pub fn run(port: u16) -> i32 {
28 match probe(port) {
29 Ok(()) => 0,
30 Err(e) => {
31 eprintln!("healthcheck failed: {e}");
32 1
33 }
34 }
35}
36
37fn probe(port: u16) -> Result<(), String> {
38 let addr = format!("127.0.0.1:{port}");

Callers 7

run_subcommandFunction · 0.70
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
run_algorithmFunction · 0.50
spawn_protocol_listenersFunction · 0.50

Calls 1

probeFunction · 0.85