Skip to content

Commit

Permalink
fix: prometheus could not be disabled (#1348)
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape authored Aug 22, 2023
1 parent ef190d7 commit 0ed2ce6
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/run/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,13 +774,12 @@ impl Axon {
}

fn run_prometheus_server(config: Option<ConfigPrometheus>) {
let prometheus_listening_address = match config {
Some(prometheus_config) => prometheus_config.listening_address.unwrap(),
None => std::net::SocketAddr::from(([0, 0, 0, 0], 8100)),
if let Some(prometheus_config) = config {
if let Some(prometheus_listening_address) = prometheus_config.listening_address {
tokio::spawn(run_prometheus_server(prometheus_listening_address));
log::info!("prometheus started");
}
};
tokio::spawn(run_prometheus_server(prometheus_listening_address));

log::info!("prometheus started");
}

fn run_overlord_consensus<M, N, S, DB>(
Expand Down

0 comments on commit 0ed2ce6

Please sign in to comment.