Skip to content

Commit

Permalink
fix: start health checker and metrics server after scc
Browse files Browse the repository at this point in the history
  • Loading branch information
dandanlen committed Oct 16, 2023
1 parent f52b2b1 commit 10a0e9e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions engine/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,6 @@ async fn main() -> anyhow::Result<()> {

let has_completed_initialising = Arc::new(AtomicBool::new(false));

if let Some(health_check_settings) = &settings.health_check {
health::start(scope, health_check_settings, has_completed_initialising.clone())
.await?;
}

if let Some(prometheus_settings) = &settings.prometheus {
metrics::start(scope, prometheus_settings).await?;
}

let (state_chain_stream, state_chain_client) =
state_chain_observer::client::StateChainClient::connect_with_account(
scope,
Expand All @@ -145,6 +136,15 @@ async fn main() -> anyhow::Result<()> {
// Wait until SCC has started, to ensure old engine has stopped
start_logger_server_fn.take().expect("only called once")(scope);

if let Some(health_check_settings) = &settings.health_check {
health::start(scope, health_check_settings, has_completed_initialising.clone())
.await?;
}

if let Some(prometheus_settings) = &settings.prometheus {
metrics::start(scope, prometheus_settings).await?;
}

let db = Arc::new(
PersistentKeyDB::open_and_migrate_to_latest(
settings.signing.db_file.as_path(),
Expand Down

0 comments on commit 10a0e9e

Please sign in to comment.