Skip to content

Commit

Permalink
refactor: nit BinMetadata creation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Nov 21, 2024
1 parent 785fe5b commit e30ebac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions core/lib/bin_metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ pub mod values {
include!(concat!(env!("OUT_DIR"), "/metadata_values.rs"));
}

pub const BIN_METADATA: BinMetadata = BinMetadata {
rust: RUST_METADATA,
git: GIT_METADATA,
};

/// Metadata of the compiled binary.
#[derive(Debug, Serialize)]
pub struct BinMetadata {
Expand Down
13 changes: 2 additions & 11 deletions core/lib/health_check/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ pub use async_trait::async_trait;
use futures::future;
use serde::Serialize;
use tokio::sync::watch;
use zksync_bin_metadata::{
values::{GIT_METADATA, RUST_METADATA},
BinMetadata,
};
use zksync_bin_metadata::BIN_METADATA;

use self::metrics::{CheckResult, METRICS};
use crate::metrics::AppHealthCheckConfig;
Expand Down Expand Up @@ -241,13 +238,7 @@ impl AppHealthCheck {
.map(|health| health.status)
.max_by_key(|status| status.priority_for_aggregation())
.unwrap_or(HealthStatus::Ready);
let inner = Health::with_details(
aggregated_status.into(),
BinMetadata {
rust: RUST_METADATA,
git: GIT_METADATA,
},
);
let inner = Health::with_details(aggregated_status.into(), BIN_METADATA);

let health = AppHealth { inner, components };
if !health.inner.status.is_healthy() {
Expand Down

0 comments on commit e30ebac

Please sign in to comment.