Browse Source

Feature #TASK_QT-18250 account_id在omni场景覆盖问题

Carl 2 months ago
parent
commit
3404d0f064
1 changed files with 4 additions and 0 deletions
  1. 4 0
      flags/flags.go

+ 4 - 0
flags/flags.go

@@ -160,6 +160,10 @@ func init() {
 	// 注意:ConfigServer 和 DataServer 的最高优先级是 common.ini(如果 RunInOmniagent 为 true)
 	// 这个逻辑在 flags.go 的 init() 中执行,确保在 Viper 配置加载之前就设置了
 	if *RunInOmniagent {
+		// omni 模式下,account_id 从 common.ini 的 token 解析,不需要通过 RegisterHost 获取
+		if os.Getenv("DISABLE_REG_HOST") == "" {
+			*DisableRegisterHost = true
+		}
 		iniData, err := ini.Load(*CommonIni)
 		if err == nil && iniData != nil {
 			*ServerPrefix = "/apm"