diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-05 14:57:56 +0100 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-12-05 14:57:56 +0100 |
commit | cc8b2cf6d529062399e0d9b4cde17f2475ef19c1 (patch) | |
tree | 8a6c0390fb87d4372af64615323483a754b95fcf /main.go | |
parent | 407b8190b86e31f5e1fbd31fae30dcbf8be36fe6 (diff) |
Only update Server URL when it's necessary.v0.1.1
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -360,8 +360,10 @@ func XdsConnInit(ctx *cli.Context) error { return cli.NewExitError("ERROR while getting XDS config: "+err.Error(), 1) } svrCfg := xdsConf.Servers[XdsServerIndexGet()] - if serverURL != "" && (svrCfg.URL != serverURL || !svrCfg.Connected) { - svrCfg.URL = serverURL + if (serverURL != "" && svrCfg.URL != serverURL) || !svrCfg.Connected { + if serverURL != "" { + svrCfg.URL = serverURL + } svrCfg.ConnRetry = 10 if err := XdsConfigSet(xdsConf); err != nil { return cli.NewExitError("ERROR while updating XDS server URL: "+err.Error(), 1) |