Add prototype to analytics if any

This commit is contained in:
Louis Dureuil 2023-02-07 16:01:12 +01:00
parent c3a30a5a91
commit f46cf46b8c
No known key found for this signature in database

View File

@ -401,12 +401,19 @@ impl Segment {
if let Ok(stats) = if let Ok(stats) =
create_all_stats(index_scheduler.into(), auth_controller, &SearchRules::default()) create_all_stats(index_scheduler.into(), auth_controller, &SearchRules::default())
{ {
// Replace the version number with the prototype name if any.
let version = if let Some(prototype) = crate::prototype_name() {
prototype
} else {
env!("CARGO_PKG_VERSION")
};
let _ = self let _ = self
.batcher .batcher
.push(Identify { .push(Identify {
context: Some(json!({ context: Some(json!({
"app": { "app": {
"version": env!("CARGO_PKG_VERSION").to_string(), "version": version.to_string(),
}, },
})), })),
user: self.user.clone(), user: self.user.clone(),