Skip to content

Commit

Permalink
Start the prometheus server before loading snapshots.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmih committed Mar 18, 2022
1 parent 8cfdc9b commit 898aa57
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions forest/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 898aa57

Please sign in to comment.