From 7e8fe4afe1247359d59377e53b0aeebbb7defd60 Mon Sep 17 00:00:00 2001 From: amigin Date: Thu, 20 Feb 2025 20:33:42 +0200 Subject: [PATCH] Added env_info to connection --- my-service-bus-tcp-client/src/new_connection_handler.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/my-service-bus-tcp-client/src/new_connection_handler.rs b/my-service-bus-tcp-client/src/new_connection_handler.rs index f9b0c2d..5df6467 100644 --- a/my-service-bus-tcp-client/src/new_connection_handler.rs +++ b/my-service-bus-tcp-client/src/new_connection_handler.rs @@ -11,8 +11,15 @@ pub async fn send_greeting( app_version: &str, client_version: &str, ) { + let mut name = format!("{}:{};{}", app_name, app_version, client_version); + + if let Ok(value) = std::env::var("ENV_INFO") { + name.push(';'); + name.push_str(&value); + } + let greeting = MySbTcpContract::Greeting { - name: format!("{}:{};{}", app_name, app_version, client_version), + name, protocol_version: DEFAULT_TCP_PROTOCOL_VERSION, };