Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

refactor

chrislu4af8c427ebb1
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index af1edea756..ee72d12850 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -156,14 +156,15 @@ func doUpload(reader io.Reader, option *UploadOption) (uploadResult *UploadResul
func retriedUploadData(data []byte, option *UploadOption) (uploadResult *UploadResult, err error) {
for i := 0; i < 3; i++ {
+ if i > 0 {
+ time.Sleep(time.Millisecond * time.Duration(237*(i+1)))
+ }
uploadResult, err = doUploadData(data, option)
if err == nil {
uploadResult.RetryCount = i
return
- } else {
- glog.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err)
}
- time.Sleep(time.Millisecond * time.Duration(237*(i+1)))
+ glog.Warningf("uploading %d to %s: %v", i, option.UploadUrl, err)
}
return
}