From 2f7c7afdec305caf2b1ea029f27b6e1b220ddc2d Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 22 Mar 2021 22:13:19 -0700 Subject: [PATCH] refactor: remove unused parameter --- weed/filer/filechunk_manifest.go | 4 ++-- weed/filer/stream.go | 21 +++------------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go index b4bfc6842..c709dc819 100644 --- a/weed/filer/filechunk_manifest.go +++ b/weed/filer/filechunk_manifest.go @@ -91,10 +91,10 @@ func fetchChunk(lookupFileIdFn wdclient.LookupFileIdFunctionType, fileId string, glog.Errorf("operation LookupFileId %s failed, err: %v", fileId, err) return nil, err } - return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, true, false, 0, 0) + return retriedFetchChunkData(urlStrings, cipherKey, isGzipped, true, 0, 0) } -func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, isCheck bool, offset int64, size int) ([]byte, error) { +func retriedFetchChunkData(urlStrings []string, cipherKey []byte, isGzipped bool, isFullChunk bool, offset int64, size int) ([]byte, error) { var err error var shouldRetry bool diff --git a/weed/filer/stream.go b/weed/filer/stream.go index 2584743c8..661a210ea 100644 --- a/weed/filer/stream.go +++ b/weed/filer/stream.go @@ -48,15 +48,7 @@ func StreamContent(masterClient wdclient.HasLookupFileIdFunction, w io.Writer, c for _, chunkView := range chunkViews { urlStrings := fileId2Url[chunkView.FileId] - data, err := retriedFetchChunkData( - urlStrings, - chunkView.CipherKey, - chunkView.IsGzipped, - chunkView.IsFullChunk(), - false, - chunkView.Offset, - int(chunkView.Size), - ) + data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size)) if err != nil { glog.Errorf("read chunk: %v", err) return fmt.Errorf("read chunk: %v", err) @@ -78,14 +70,7 @@ func CheckAllChunkViews(chunkViews []*ChunkView, fileId2Url *map[string][]string urlStrings := (*fileId2Url)[chunkView.FileId] glog.V(9).Infof("Check chunk: %+v\n url: %v", chunkView, urlStrings) gErr.Go(func() error { - _, err := retriedFetchChunkData( - urlStrings, - chunkView.CipherKey, - chunkView.IsGzipped, - chunkView.IsFullChunk(), - true, - chunkView.Offset, - int(chunkView.Size)) + _, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size)) return err }) } @@ -110,7 +95,7 @@ func ReadAll(masterClient *wdclient.MasterClient, chunks []*filer_pb.FileChunk) return nil, err } - data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), false, chunkView.Offset, int(chunkView.Size)) + data, err := retriedFetchChunkData(urlStrings, chunkView.CipherKey, chunkView.IsGzipped, chunkView.IsFullChunk(), chunkView.Offset, int(chunkView.Size)) if err != nil { return nil, err }