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
1 changed files with 8 additions and 1 deletions

View File

@ -401,12 +401,19 @@ impl Segment {
if let Ok(stats) =
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
.batcher
.push(Identify {
context: Some(json!({
"app": {
"version": env!("CARGO_PKG_VERSION").to_string(),
"version": version.to_string(),
},
})),
user: self.user.clone(),