Skip to content

Commit

Permalink
Metrics CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoquick committed Dec 18, 2023
1 parent d8b2fad commit 3749290
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/bin/bitmaskd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ async fn csv_metrics() -> Result<impl IntoResponse, AppError> {
async fn init_metrics() -> Result<()> {
let dir = env::var("CARBONADO_DIR").unwrap_or("/tmp/bitmaskd/carbonado".to_owned());
let dir = path::Path::new(&dir);
fs::create_dir_all(dir).await?;

info!("Starting metrics collection...");
let duration = Instant::now();
Expand Down Expand Up @@ -821,14 +822,14 @@ async fn main() -> Result<()> {
app = app
.route("/regtest/block", get(new_block))
.route("/regtest/send/:address/:amount", get(send_coins));
} else {
tokio::spawn(async {
if let Err(e) = init_metrics().await {
error!("Error in init metrics: {e}");
}
});
}

tokio::spawn(async {
if let Err(e) = init_metrics().await {
error!("Error in init metrics: {e}");
}
});

let app = app.layer(CorsLayer::permissive());
let addr = SocketAddr::from(([0, 0, 0, 0], 7070));

Expand Down

0 comments on commit 3749290

Please sign in to comment.