projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
15397: Remove code, configs, and docs for hosted git repo feature.
[arvados.git]
/
sdk
/
go
/
arvados
/
client.go
diff --git
a/sdk/go/arvados/client.go
b/sdk/go/arvados/client.go
index e3c14326600189ed92f0b5af14db83f244d010f5..7bc3d5bc420404559939247b04cb4b7849c620d6 100644
(file)
--- a/
sdk/go/arvados/client.go
+++ b/
sdk/go/arvados/client.go
@@
-77,6
+77,11
@@
type Client struct {
// context deadline to establish a maximum request time.
Timeout time.Duration
// context deadline to establish a maximum request time.
Timeout time.Duration
+ // Maximum disk cache size in bytes or percent of total
+ // filesystem size. If zero, use default, currently 10% of
+ // filesystem size.
+ DiskCacheSize ByteSizeOrPercent
+
dd *DiscoveryDocument
defaultRequestID string
dd *DiscoveryDocument
defaultRequestID string
@@
-154,6
+159,7
@@
func NewClientFromConfig(cluster *Cluster) (*Client, error) {
APIHost: ctrlURL.Host,
Insecure: cluster.TLS.Insecure,
Timeout: 5 * time.Minute,
APIHost: ctrlURL.Host,
Insecure: cluster.TLS.Insecure,
Timeout: 5 * time.Minute,
+ DiskCacheSize: cluster.Collections.WebDAVCache.DiskCacheSize,
requestLimiter: &requestLimiter{maxlimit: int64(cluster.API.MaxConcurrentRequests / 4)},
}, nil
}
requestLimiter: &requestLimiter{maxlimit: int64(cluster.API.MaxConcurrentRequests / 4)},
}, nil
}
@@
-301,6
+307,11
@@
func (c *Client) Do(req *http.Request) (*http.Response, error) {
if c.Timeout == 0 {
return false, nil
}
if c.Timeout == 0 {
return false, nil
}
+ // This check can be removed when
+ // https://github.com/hashicorp/go-retryablehttp/pull/210
+ // (or equivalent) is merged and we update go.mod.
+ // Until then, it is needed to pass
+ // TestNonRetryableStdlibError.
if respErr != nil && reqErrorRe.MatchString(respErr.Error()) {
return false, nil
}
if respErr != nil && reqErrorRe.MatchString(respErr.Error()) {
return false, nil
}