From 898aa57381b7d2f4257b3521e49723d648c4e56e Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Fri, 18 Mar 2022 17:11:01 +0100 Subject: [PATCH 1/2] Start the prometheus server before loading snapshots. --- forest/src/daemon.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/forest/src/daemon.rs b/forest/src/daemon.rs index 15b6a5140f1b..e5dbf5f0816a 100644 --- a/forest/src/daemon.rs +++ b/forest/src/daemon.rs @@ -106,6 +106,18 @@ pub(super) async fn start(config: Config) { .unwrap(); } + // Start Prometheus server port + let prometheus_server_task = task::spawn(metrics::init_prometheus( + (format!("127.0.0.1:{}", config.metrics_port)) + .parse() + .unwrap(), + PathBuf::from(&config.data_dir) + .join("db") + .into_os_string() + .into_string() + .expect("Failed converting the path to db"), + )); + // Print admin token let ki = ks.get(JWT_IDENTIFIER).unwrap(); let token = create_token(ADMIN.to_owned(), ki.private_key()).unwrap(); @@ -226,18 +238,6 @@ pub(super) async fn start(config: Config) { None }; - // Start Prometheus server port - let prometheus_server_task = task::spawn(metrics::init_prometheus( - (format!("127.0.0.1:{}", config.metrics_port)) - .parse() - .unwrap(), - PathBuf::from(&config.data_dir) - .join("db") - .into_os_string() - .into_string() - .expect("Failed converting the path to db"), - )); - // Block until ctrl-c is hit block_until_sigint().await; From f73fa38c7fea7bcdb0a2ae3b6162d1de71bbc72b Mon Sep 17 00:00:00 2001 From: David Himmelstrup Date: Mon, 21 Mar 2022 08:30:25 +0100 Subject: [PATCH 2/2] Empty commit