diff options
Diffstat (limited to 'weed/util')
| -rw-r--r-- | weed/util/compression.go | 7 | ||||
| -rw-r--r-- | weed/util/constants.go | 2 | ||||
| -rw-r--r-- | weed/util/http_util.go | 5 | ||||
| -rw-r--r-- | weed/util/retry.go | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/weed/util/compression.go b/weed/util/compression.go index 33506834b..9d52810cb 100644 --- a/weed/util/compression.go +++ b/weed/util/compression.go @@ -55,15 +55,14 @@ func GzipData(input []byte) ([]byte, error) { return buf.Bytes(), nil } - func DecompressData(input []byte) ([]byte, error) { if IsGzippedContent(input) { return ungzipData(input) } /* - if IsZstdContent(input) { - return unzstdData(input) - } + if IsZstdContent(input) { + return unzstdData(input) + } */ return input, UnsupportedCompression } diff --git a/weed/util/constants.go b/weed/util/constants.go index 0aeee111e..254f3cb59 100644 --- a/weed/util/constants.go +++ b/weed/util/constants.go @@ -5,7 +5,7 @@ import ( ) var ( - VERSION = fmt.Sprintf("%s %d.%02d", sizeLimit, 2, 11) + VERSION = fmt.Sprintf("%s %d.%02d", sizeLimit, 2, 13) COMMIT = "" ) diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 7851d8293..2cd69b01b 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -374,3 +374,8 @@ func CloseResponse(resp *http.Response) { io.Copy(ioutil.Discard, resp.Body) resp.Body.Close() } + +func CloseRequest(req *http.Request) { + io.Copy(ioutil.Discard, req.Body) + req.Body.Close() +} diff --git a/weed/util/retry.go b/weed/util/retry.go index 85c4d150d..7b0f2d3c3 100644 --- a/weed/util/retry.go +++ b/weed/util/retry.go @@ -22,9 +22,11 @@ func Retry(name string, job func() error) (err error) { } if strings.Contains(err.Error(), "transport") { hasErr = true - glog.V(0).Infof("retry %s", name) + glog.V(0).Infof("retry %s: err: %v", name, err) time.Sleep(waitTime) waitTime += waitTime / 2 + } else { + break } } return err |
