fix: etag has to be provided to multipart complete
This commit is contained in:
parent
185f5de87a
commit
a3846a8e07
|
@ -169,7 +169,7 @@ func (r *RenterDefault) MultipartUpload(params MultiPartUploadParams) error {
|
||||||
if end > size {
|
if end > size {
|
||||||
end = size
|
end = size
|
||||||
}
|
}
|
||||||
nextChan := make(chan struct{}, 0)
|
nextChan := make(chan string, 0)
|
||||||
errChan := make(chan error, 0)
|
errChan := make(chan error, 0)
|
||||||
|
|
||||||
partNumber := int(i + 1)
|
partNumber := int(i + 1)
|
||||||
|
@ -189,12 +189,12 @@ func (r *RenterDefault) MultipartUpload(params MultiPartUploadParams) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = r.workerClient.UploadMultipartUploadPart(context.Background(), reader, bucket, fileName, upload.UploadID, partNumber, api.UploadMultipartUploadPartOptions{})
|
ret, err := r.workerClient.UploadMultipartUploadPart(context.Background(), reader, bucket, fileName, upload.UploadID, partNumber, api.UploadMultipartUploadPartOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
nextChan <- struct{}{}
|
nextChan <- ret.ETag
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
Limit: 10,
|
Limit: 10,
|
||||||
|
@ -219,7 +219,8 @@ func (r *RenterDefault) MultipartUpload(params MultiPartUploadParams) error {
|
||||||
select {
|
select {
|
||||||
case err = <-errChan:
|
case err = <-errChan:
|
||||||
return fmt.Errorf("failed to upload part %d: %s", i, err.Error())
|
return fmt.Errorf("failed to upload part %d: %s", i, err.Error())
|
||||||
case <-nextChan:
|
case etag := <-nextChan:
|
||||||
|
uploadParts[i].ETag = etag
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue