diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-06 16:20:49 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-06 16:20:49 -0700 |
| commit | 6923af7280ed341ce90313df5e8eabaaf8e7aa47 (patch) | |
| tree | 57db6d3e15db9b85a966c84a51e78c3b590163e2 /weed/replication | |
| parent | 64f6532fbeb5e35028a19717186f712a14cbd13e (diff) | |
| download | seaweedfs-6923af7280ed341ce90313df5e8eabaaf8e7aa47.tar.xz seaweedfs-6923af7280ed341ce90313df5e8eabaaf8e7aa47.zip | |
refactoring
Diffstat (limited to 'weed/replication')
| -rw-r--r-- | weed/replication/sink/filersink/fetch_write.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/weed/replication/sink/filersink/fetch_write.go b/weed/replication/sink/filersink/fetch_write.go index b5ea3e2cb..e253eb96c 100644 --- a/weed/replication/sink/filersink/fetch_write.go +++ b/weed/replication/sink/filersink/fetch_write.go @@ -107,7 +107,16 @@ func (fs *FilerSink) fetchAndWrite(sourceChunk *filer_pb.FileChunk, path string) glog.V(4).Infof("replicating %s to %s header:%+v", filename, fileUrl, header) // fetch data as is, regardless whether it is encrypted or not - uploadResult, err, _ := operation.Upload(fileUrl, filename, false, resp.Body, "gzip" == header.Get("Content-Encoding"), header.Get("Content-Type"), nil, auth) + uploadOption := &operation.UploadOption{ + UploadUrl: fileUrl, + Filename: filename, + Cipher: false, + IsInputCompressed: "gzip" == header.Get("Content-Encoding"), + MimeType: header.Get("Content-Type"), + PairMap: nil, + Jwt: auth, + } + uploadResult, err, _ := operation.Upload(resp.Body, uploadOption) if err != nil { glog.V(0).Infof("upload source data %v to %s: %v", sourceChunk.GetFileIdString(), fileUrl, err) return "", fmt.Errorf("upload data: %v", err) |
