aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/upload_content.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-03-07 11:26:15 -0800
committerChris Lu <chris.lu@gmail.com>2021-03-07 11:26:15 -0800
commitdf72dc206d9064daa79439ef9f3fb83f491eebd8 (patch)
treee91937939105a791409f49b8fcbe3b6dc45bde3c /weed/operation/upload_content.go
parent726edab054208d1f2f8ab83c08687c1871bfb0a9 (diff)
downloadseaweedfs-df72dc206d9064daa79439ef9f3fb83f491eebd8.tar.xz
seaweedfs-df72dc206d9064daa79439ef9f3fb83f491eebd8.zip
stats collect chunk upload retry count
Diffstat (limited to 'weed/operation/upload_content.go')
-rw-r--r--weed/operation/upload_content.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go
index 70428bb07..4bfc08425 100644
--- a/weed/operation/upload_content.go
+++ b/weed/operation/upload_content.go
@@ -31,6 +31,7 @@ type UploadResult struct {
Mime string `json:"mime,omitempty"`
Gzip uint32 `json:"gzip,omitempty"`
ContentMd5 string `json:"contentMd5,omitempty"`
+ RetryCount int `json:"-"`
}
func (uploadResult *UploadResult) ToPbFileChunk(fileId string, offset int64) *filer_pb.FileChunk {
@@ -94,6 +95,7 @@ func doUpload(uploadUrl string, filename string, cipher bool, reader io.Reader,
func retriedUploadData(uploadUrl string, filename string, cipher bool, data []byte, isInputCompressed bool, mtype string, pairMap map[string]string, jwt security.EncodedJwt) (uploadResult *UploadResult, err error) {
for i := 0; i < 3; i++ {
+ uploadResult.RetryCount = i
uploadResult, err = doUploadData(uploadUrl, filename, cipher, data, isInputCompressed, mtype, pairMap, jwt)
if err == nil {
return