diff options
| author | Aleksey Kosov <rusyak777@list.ru> | 2025-05-28 21:34:02 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-28 11:34:02 -0700 |
| commit | 283d9e0079d5deb57aefe9a7b30e8b9869ba8685 (patch) | |
| tree | 87b09bebed2ee4afc9c2a4f711ac8598fe2949b7 /weed/replication/repl_util/replication_util.go | |
| parent | 62aaaa18f3ea8b7600d28934580dc220ca95164a (diff) | |
| download | seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.tar.xz seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.zip | |
Add context with request (#6824)
Diffstat (limited to 'weed/replication/repl_util/replication_util.go')
| -rw-r--r-- | weed/replication/repl_util/replication_util.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/replication/repl_util/replication_util.go b/weed/replication/repl_util/replication_util.go index 4a77fd04a..57c206e3e 100644 --- a/weed/replication/repl_util/replication_util.go +++ b/weed/replication/repl_util/replication_util.go @@ -1,6 +1,7 @@ package repl_util import ( + "context" "github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/replication/source" @@ -12,7 +13,7 @@ func CopyFromChunkViews(chunkViews *filer.IntervalList[*filer.ChunkView], filerS for x := chunkViews.Front(); x != nil; x = x.Next { chunk := x.Value - fileUrls, err := filerSource.LookupFileId(chunk.FileId) + fileUrls, err := filerSource.LookupFileId(context.Background(), chunk.FileId) if err != nil { return err } @@ -21,7 +22,7 @@ func CopyFromChunkViews(chunkViews *filer.IntervalList[*filer.ChunkView], filerS var shouldRetry bool for _, fileUrl := range fileUrls { - shouldRetry, err = util_http.ReadUrlAsStream(fileUrl, chunk.CipherKey, chunk.IsGzipped, chunk.IsFullChunk(), chunk.OffsetInChunk, int(chunk.ViewSize), func(data []byte) { + shouldRetry, err = util_http.ReadUrlAsStream(context.Background(), fileUrl, chunk.CipherKey, chunk.IsGzipped, chunk.IsFullChunk(), chunk.OffsetInChunk, int(chunk.ViewSize), func(data []byte) { writeErr = writeFunc(data) }) if err != nil { |
