Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lean_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use fork_choice::{
};
use http_api::HttpServerConfig;
use libp2p_identity::Keypair;
use metrics::{METRICS, Metrics, MetricsServerConfig};
use metrics::{METRICS, Metrics};
use networking::gossipsub::config::GossipsubConfig;
use networking::gossipsub::topic::get_topics;
use networking::network::{NetworkService, NetworkServiceConfig};
Expand Down Expand Up @@ -377,9 +377,11 @@ async fn main() -> Result<()> {

let chain_outbound_sender = outbound_p2p_sender.clone();

let http_handle = task::spawn(async move {
if let Err(err) = http_api::run_server(args.http_config).await {
error!("HTTP Server failed with error: {err:?}");
task::spawn(async move {
if args.http_config.metrics_enabled() {
if let Err(err) = http_api::run_server(args.http_config).await {
error!("HTTP Server failed with error: {err:?}");
}
}
});

Expand Down Expand Up @@ -606,9 +608,6 @@ async fn main() -> Result<()> {
_ = chain_handle => {
info!("Chain service finished.");
}
_ = http_handle => {
info!("Http service finished.");
}
}

info!("Main async task exiting...");
Expand Down
Loading