From 2531373044cad4e6ccbe098e8a164e49f7447acd Mon Sep 17 00:00:00 2001 From: Oleksandr Mazur Date: Thu, 4 Jul 2024 10:32:11 +0300 Subject: [PATCH] CGW: TopoMap: Disable by default Change current behavior of CGW to the TopoMap feature by default, as it's current implementation is very unstable with high number of devices sending their state info data. Signed-off-by: Oleksandr Mazur --- run_cgw.sh | 2 +- src/main.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/run_cgw.sh b/run_cgw.sh index c37a424..15f3d75 100755 --- a/run_cgw.sh +++ b/run_cgw.sh @@ -111,7 +111,7 @@ docker run \ -e CGW_DB_PASSWORD \ -e CGW_REDIS_HOST \ -e CGW_REDIS_PORT \ - -e CGW_FEATURE_TOPOMAP_DISABLE \ + -e CGW_FEATURE_TOPOMAP_ENABLE \ -e CGW_METRICS_PORT \ -e CGW_ALLOW_CERT_MISMATCH \ -d -t --network=host --name $2 $1 ucentral-cgw diff --git a/src/main.rs b/src/main.rs index 55d4b47..a50a710 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,7 +95,7 @@ const CGW_DEFAULT_REDIS_HOST: &str = "localhost"; const CGW_DEFAULT_REDIS_PORT: u16 = 6379; const CGW_DEFAULT_ALLOW_CERT_MISMATCH: &str = "no"; const CGW_DEFAULT_METRICS_PORT: u16 = 8080; -const CGW_DEFAULT_TOPOMAP_STATE: bool = true; +const CGW_DEFAULT_TOPOMAP_STATE: bool = false; /// CGW server pub struct AppArgs { @@ -397,8 +397,8 @@ impl AppArgs { Err(_) => CGW_DEFAULT_METRICS_PORT, }; - let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_DISABLE") { - Ok(_) => false, + let feature_topomap_enabled: bool = match env::var("CGW_FEATURE_TOPOMAP_ENABLE") { + Ok(_) => true, Err(_) => CGW_DEFAULT_TOPOMAP_STATE, }; @@ -637,8 +637,8 @@ async fn main() -> Result<()> { // Configure logger setup_logger(args.log_level); - if !args.feature_topomap_enabled { - warn!("CGW_FEATURE_TOPOMAP_DISABLE is set, TOPO MAP feature will be disabled (realtime events / state processing)"); + if args.feature_topomap_enabled { + warn!("CGW_FEATURE_TOPOMAP_ENABLE is set, TOPO MAP feature (unstable) will be enabled (realtime events / state processing) - heavy performance drop with high number of devices connected could be observed"); } info!(