diff --git a/src/poller/scheduler.rs b/src/poller/scheduler.rs index cd69a5b..dc708c5 100644 --- a/src/poller/scheduler.rs +++ b/src/poller/scheduler.rs @@ -161,7 +161,7 @@ impl Scheduler { .unwrap_or_else(|| "unknown".to_string()); let metadata = HeartbeatMetadata { - version: env!("CARGO_PKG_VERSION").to_string(), + version: crate::version::current_version().to_string(), hostname, uptime_seconds: uptime, }; diff --git a/src/version.rs b/src/version.rs index f1f8121..ba367b7 100644 --- a/src/version.rs +++ b/src/version.rs @@ -1,5 +1,5 @@ -// Get version at runtime - prefers BUILD_VERSION from build.rs, falls back to Cargo.toml -fn current_version() -> &'static str { +/// Get version at runtime - prefers BUILD_VERSION from build.rs, falls back to Cargo.toml +pub fn current_version() -> &'static str { option_env!("BUILD_VERSION").unwrap_or(env!("CARGO_PKG_VERSION")) }