X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6fab045dba4714e9c748337ef974ef257df37353..d7b6ec65cfd774f0d17c96d2baf9b6620c55ad8d:/sdk/go/keepclient/discover.go diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go index 650c2b5f61..f039c21810 100644 --- a/sdk/go/keepclient/discover.go +++ b/sdk/go/keepclient/discover.go @@ -57,14 +57,14 @@ func (kc *KeepClient) RefreshServices(interval, errInterval time.Duration) { timer.Reset(interval) if err := kc.DiscoverKeepServers(); err != nil { - log.Println("Error retrieving services list: %v (retrying in %v)", err, errInterval) + log.Printf("WARNING: Error retrieving services list: %v (retrying in %v)", err, errInterval) timer.Reset(errInterval) continue } newRoots := []map[string]string{kc.LocalRoots(), kc.GatewayRoots()} if !reflect.DeepEqual(previousRoots, newRoots) { - log.Printf("Updated services list: locals %v gateways %v", newRoots[0], newRoots[1]) + DebugPrintf("DEBUG: Updated services list: locals %v gateways %v", newRoots[0], newRoots[1]) previousRoots = newRoots } @@ -84,7 +84,6 @@ func (this *KeepClient) loadKeepServers(list svcList) error { // replicasPerService is 1 for disks; unknown or unlimited otherwise this.replicasPerService = 1 - this.Using_proxy = false for _, service := range list.Items { scheme := "http" @@ -100,10 +99,6 @@ func (this *KeepClient) loadKeepServers(list svcList) error { listed[url] = true localRoots[service.Uuid] = url - if service.SvcType == "proxy" { - this.Using_proxy = true - } - if service.ReadOnly == false { writableLocalRoots[service.Uuid] = url if service.SvcType != "disk" { @@ -111,6 +106,10 @@ func (this *KeepClient) loadKeepServers(list svcList) error { } } + if service.SvcType != "disk" { + this.foundNonDiskSvc = true + } + // Gateway services are only used when specified by // UUID, so there's nothing to gain by filtering them // by service type. Including all accessible services @@ -119,8 +118,8 @@ func (this *KeepClient) loadKeepServers(list svcList) error { gatewayRoots[service.Uuid] = url } - if this.Using_proxy { - this.setClientSettingsProxy() + if this.foundNonDiskSvc { + this.setClientSettingsNonDisk() } else { this.setClientSettingsDisk() }