remove duplicate env var

This commit is contained in:
Anish Mukherjee 2023-02-27 21:19:59 +05:30
parent b803e64ee4
commit c57c892119
2 changed files with 4 additions and 5 deletions

View file

@ -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"`

View file

@ -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
}