diff options
| author | chrislu <chris.lu@gmail.com> | 2022-08-20 18:14:57 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-08-20 18:14:57 -0700 |
| commit | 689b4ecdcc9dc6edeaf557a6988f520e1fe608ac (patch) | |
| tree | 11f94a2034b6a6f3f60c4cc29b532c6e1c7a9174 /weed/mount/weedfs_write.go | |
| parent | e3f40d538d3184d5e84a953146516ddc85f151a5 (diff) | |
| download | seaweedfs-689b4ecdcc9dc6edeaf557a6988f520e1fe608ac.tar.xz seaweedfs-689b4ecdcc9dc6edeaf557a6988f520e1fe608ac.zip | |
remove unused collection and replication from upload result
Diffstat (limited to 'weed/mount/weedfs_write.go')
| -rw-r--r-- | weed/mount/weedfs_write.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/weed/mount/weedfs_write.go b/weed/mount/weedfs_write.go index 378fd0a0f..55694b46d 100644 --- a/weed/mount/weedfs_write.go +++ b/weed/mount/weedfs_write.go @@ -15,7 +15,7 @@ import ( func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFunctionType { - return func(reader io.Reader, filename string, offset int64) (chunk *filer_pb.FileChunk, collection, replication string, err error) { + return func(reader io.Reader, filename string, offset int64) (chunk *filer_pb.FileChunk, err error) { var fileId, host string var auth security.EncodedJwt @@ -43,12 +43,11 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun fileId, auth = resp.FileId, security.EncodedJwt(resp.Auth) loc := resp.Location host = wfs.AdjustedUrl(loc) - collection, replication = resp.Collection, resp.Replication return nil }) }); err != nil { - return nil, "", "", fmt.Errorf("filerGrpcAddress assign volume: %v", err) + return nil, fmt.Errorf("filerGrpcAddress assign volume: %v", err) } fileUrl := fmt.Sprintf("http://%s/%s", host, fileId) @@ -67,11 +66,11 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun uploadResult, err, data := operation.Upload(reader, uploadOption) if err != nil { glog.V(0).Infof("upload data %v to %s: %v", filename, fileUrl, err) - return nil, "", "", fmt.Errorf("upload data: %v", err) + return nil, fmt.Errorf("upload data: %v", err) } if uploadResult.Error != "" { glog.V(0).Infof("upload failure %v to %s: %v", filename, fileUrl, err) - return nil, "", "", fmt.Errorf("upload result: %v", uploadResult.Error) + return nil, fmt.Errorf("upload result: %v", uploadResult.Error) } if offset == 0 { @@ -79,6 +78,6 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun } chunk = uploadResult.ToPbFileChunk(fileId, offset) - return chunk, collection, replication, nil + return chunk, nil } } |
