Run the healthcheck. Returns process exit code: - `0` — `/health` returned 2xx - `1` — connection / I/O / non-2xx
(port: u16)
| 25 | /// - `0` — `/health` returned 2xx |
| 26 | /// - `1` — connection / I/O / non-2xx |
| 27 | pub 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 | |
| 37 | fn probe(port: u16) -> Result<(), String> { |
| 38 | let addr = format!("127.0.0.1:{port}"); |