Add git commit hash to intercom status version reporting

This commit is contained in:
NG (Graham) committed 2026-02-08 11:18:25 -05:00
1 parent 93beb1b4e7
commit f1c6a5b707
13 files changed
+37 -11

No files matched your search

+4 -1
View File
@@ -60,12 +60,15 @@ async fn main() -> std::io::Result<()> {
}
pub async fn update_status(user_info: &dyn oj_rc_core::persist::user::IntercomUser, player_count: u64) {
let version = env!("CARGO_PKG_VERSION");
let git_version = git_version::git_version!(args = ["--always", "--dirty=+"]);
let full_version = format!("{}:{}", version, git_version);
user_info.update_status(
env!("CARGO_PKG_NAME"),
oj_serdes::ServerStatus {
uptime_s: (chrono::Utc::now().timestamp() - crate::START_TIMESTAMP_S.load(std::sync::atomic::Ordering::Relaxed)).try_into().unwrap_or_default(),
players: player_count,
version: env!("CARGO_PKG_VERSION").to_owned(),
version: full_version,
},
).await;
}