Browse Source

remove duplicate env var

Anish Mukherjee 2 years ago
parent
commit
c57c892119
2 changed files with 4 additions and 5 deletions
  1. 1 2
      config/config.go
  2. 3 3
      servercfg/serverconf.go

+ 1 - 2
config/config.go

@@ -36,7 +36,7 @@ type ServerConfig struct {
 	APIConnString         string `yaml:"apiconn"`
 	APIHost               string `yaml:"apihost"`
 	APIPort               string `yaml:"apiport"`
-	BrokerEndpoint        string `yaml:"brokerendpoint"`
+	Broker                string `yam:"broker"`
 	ServerBrokerEndpoint  string `yaml:"serverbrokerendpoint"`
 	BrokerType            string `yaml:"brokertype"`
 	EmqxRestEndpoint      string `yaml:"emqxrestendpoint"`
@@ -66,7 +66,6 @@ type ServerConfig struct {
 	Telemetry             string `yaml:"telemetry"`
 	HostNetwork           string `yaml:"hostnetwork"`
 	Server                string `yaml:"server"`
-	Broker                string `yam:"broker"`
 	PublicIPService       string `yaml:"publicipservice"`
 	MQPassword            string `yaml:"mqpassword"`
 	MQUserName            string `yaml:"mqusername"`

+ 3 - 3
servercfg/serverconf.go

@@ -230,7 +230,7 @@ func GetPublicBrokerEndpoint() string {
 	if os.Getenv("BROKER_ENDPOINT") != "" {
 		return os.Getenv("BROKER_ENDPOINT")
 	} else {
-		return config.Config.Server.BrokerEndpoint
+		return config.Config.Server.Broker
 	}
 }
 
@@ -243,8 +243,8 @@ func GetMessageQueueEndpoint() (string, bool) {
 		host = config.Config.Server.ServerBrokerEndpoint
 	} else if os.Getenv("BROKER_ENDPOINT") != "" {
 		host = os.Getenv("BROKER_ENDPOINT")
-	} else if config.Config.Server.BrokerEndpoint != "" {
-		host = config.Config.Server.BrokerEndpoint
+	} else if config.Config.Server.Broker != "" {
+		host = config.Config.Server.Broker
 	} else {
 		host += ":1883" // default
 	}