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/source/filer_source.go | |
| parent | 62aaaa18f3ea8b7600d28934580dc220ca95164a (diff) | |
| download | seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.tar.xz seaweedfs-283d9e0079d5deb57aefe9a7b30e8b9869ba8685.zip | |
Add context with request (#6824)
Diffstat (limited to 'weed/replication/source/filer_source.go')
| -rw-r--r-- | weed/replication/source/filer_source.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/replication/source/filer_source.go b/weed/replication/source/filer_source.go index 768e251a4..8a63d0c8f 100644 --- a/weed/replication/source/filer_source.go +++ b/weed/replication/source/filer_source.go @@ -55,7 +55,7 @@ func (fs *FilerSource) DoInitialize(address, grpcAddress string, dir string, rea return nil } -func (fs *FilerSource) LookupFileId(part string) (fileUrls []string, err error) { +func (fs *FilerSource) LookupFileId(ctx context.Context, part string) (fileUrls []string, err error) { vid2Locations := make(map[string]*filer_pb.Locations) @@ -63,7 +63,7 @@ func (fs *FilerSource) LookupFileId(part string) (fileUrls []string, err error) err = fs.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error { - resp, err := client.LookupVolume(context.Background(), &filer_pb.LookupVolumeRequest{ + resp, err := client.LookupVolume(ctx, &filer_pb.LookupVolumeRequest{ VolumeIds: []string{vid}, }) if err != nil { @@ -110,7 +110,7 @@ func (fs *FilerSource) ReadPart(fileId string) (filename string, header http.Hea return util_http.DownloadFile("http://"+fs.address+"/?proxyChunkId="+fileId, "") } - fileUrls, err := fs.LookupFileId(fileId) + fileUrls, err := fs.LookupFileId(context.Background(), fileId) if err != nil { return "", nil, nil, err } |
