do not prematurely default multipart to 16MiB

This commit is contained in:
Harshavardhana
2021-07-27 08:42:07 -07:00
parent addaf66de8
commit 4af8b2d20b
+7 -3
View File
@@ -555,9 +555,13 @@ func uploadSourceToTargetURL(ctx context.Context, urls URLs, progress io.Reader,
metadata[http.CanonicalHeaderKey(k)] = v
}
multipartSize, e := humanize.ParseBytes(env.Get("MC_UPLOAD_MULTIPART_SIZE", "16MiB"))
if e != nil {
return urls.WithError(probe.NewError(e))
var e error
var multipartSize uint64
if v := env.Get("MC_UPLOAD_MULTIPART_SIZE", ""); v != "" {
multipartSize, e = humanize.ParseBytes(v)
if e != nil {
return urls.WithError(probe.NewError(e))
}
}
multipartThreads, e := strconv.Atoi(env.Get("MC_UPLOAD_MULTIPART_THREADS", "4"))