From 1bbc8090f3d7b750d8f87bd79664bade2f7bc345 Mon Sep 17 00:00:00 2001 From: Vadim Kharitonov Date: Mon, 1 Aug 2022 12:53:52 +0200 Subject: [PATCH] [issue #1591] Add `neon_local pageserver status` handler --- neon_local/src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neon_local/src/main.rs b/neon_local/src/main.rs index 24b40b72d6..c4dd52e183 100644 --- a/neon_local/src/main.rs +++ b/neon_local/src/main.rs @@ -910,6 +910,15 @@ fn handle_pageserver(sub_match: &ArgMatches, env: &local_env::LocalEnv) -> Resul exit(1); } } + + Some(("status", _)) => match PageServerNode::from_env(env).check_status() { + Ok(_) => println!("Page server is up and running"), + Err(err) => { + eprintln!("Page server is not available: {}", err); + exit(1); + } + }, + Some((sub_name, _)) => bail!("Unexpected pageserver subcommand '{}'", sub_name), None => bail!("no pageserver subcommand provided"), }